An Elm Primer for React Developers
/
Part II: The Outside World: Randomness, APIs, and JavaScript
/
Chapter 7: JSON Decoders and Type Safety
Chapter 7: JSON Decoders and Type Safety
https://leanpub.com/elm-for-react-devs
Why JSON Needs Decoding in Elm
https://leanpub.com/elm-for-react-devs
Example: Optional fields -> Maybe
https://leanpub.com/elm-for-react-devs
Example: Nested objects and lists
https://leanpub.com/elm-for-react-devs
Example: Reaching deep with
Decode.at
https://leanpub.com/elm-for-react-devs
Supporting JSON in Our LGTM Generator
https://leanpub.com/elm-for-react-devs
Step 1: Decode Just the Phrase
https://leanpub.com/elm-for-react-devs
Step 2: Decode the Full Payload
https://leanpub.com/elm-for-react-devs
What Just Happened?
https://leanpub.com/elm-for-react-devs
What About Sending JSON?
https://leanpub.com/elm-for-react-devs
What You Just Learned
https://leanpub.com/elm-for-react-devs
Further Reading
https://leanpub.com/elm-for-react-devs
Up next
Chapter 8: JavaScript Interop: Ports and Flags
In this chapter
Chapter 7: JSON Decoders and Type Safety
Why JSON Needs Decoding in Elm
Supporting JSON in Our LGTM Generator
What About Sending JSON?
What You Just Learned
Further Reading