Decode.Pipeline
Pipeline decoders present an alternative to the mapN
style. They read more naturally, but can lead to harder-to-understand type errors.
let person_decoder : person decoder =
decode as_person
|> required "name" string
|> required "age" int
val decode : 'a -> 'a decoder