Experimental JSON decoding API

It seems tedious having to repeat the field names (or name the intermediate values something else). I would love an API where you could specify the decoders right at the record instantiation, like this:

decoder : Decoder User
decoder = somethingHere {id = require "id" int, name = require "name" string}

This might not be possible in Elm, but if it were, it would solve the ordering issue without introducing even more code than in the current pipeline case.

1 Like