~/talk

Roc-Solid Intuition for JSON Decoding

Talkat Lambda World 2024 · 2024-10-02..10-04· [functional-programming]
slides:none on file

Builds a reusable JSON decoder library in Roc that models JSON as tag unions (string, number as unsigned 64‑bit int, boolean, object, array) and models failures with a DecodingError tag union returned in a Result type. Implements primitive decoders, an array decoder using mapTry, a field decoder for objects, combinators (map2/map3) to assemble records, and a dictionary‑based tag decoder for discriminated unions, cutting the original boilerplate roughly in half.

AI-written summary · about

  1. 0:00Welcome
  2. 0:46Modeling JSON with tag unions
  3. 3:35Decoding simple types
  4. 7:46Handling errors
  5. 11:00Decoding complex lists
  6. 13:49Boilerplate and concerns
  7. 15:13Reusable primitive decoders
  8. 16:38Decoding arrays generically
  9. 18:46Decoding objects to records
  10. 21:58Combining field decoders
  11. 23:24Introducing map2
  12. 26:09Decoding unions with discriminators
  13. 28:18Building a tag decoder
  14. 30:44Refactoring to library
  15. 31:48Summary of benefits
  16. 32:29Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.