Intro to Decoders
summary
Library bs-decoders decodes JSON into custom Reason/OCaml domain types using composable combinators, not magic deriving. It gives contextual error messages (for example: while decoding a list in the second element expected int got true), supports variant dispatching and try-first decoders for ambiguous layouts, and provides a functor-based backend abstraction so the same decoders work with Yojson, Easy_json, BuckleScript, or native. Repo and npm package are available.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 0:43Decoders library
- 3:21Decoders vs PBX
- 5:11Basic usage
- 6:58Custom types capitalization
- 8:54Variant types like shapes
- 12:05Ambiguous JSON handling
- 13:09Sharing decoders Reason Bucklescript
- 15:17Roles and user decoders
- 16:31Library availability summary
related talks
18mUsing Elm's Json Decoders in Angular
27mDecoding Perplexing TypeScript
27mReasonML for Skeptics
30mUse ReasonML in your React applications
33mContravariance: intuition building from first principles
36mHaving Your Cake and Eating It Too — GraphQL in Reason
40mEnhanced safety with types
24mState of the Reason Editor integration
