In decoders there is a pattern that looks like this:
(field "id" int)
I want to see the resulting value of this immediately because there is another field that I want to set based on the id. How can I do that?
participantDecoder : Int -> Decoder Participant participantDecoder id = let actualInt = field "id" int -- need to turn into actual int idsMatch = id == actualInt -- Int /= Decoder Int in D.map2 Participant (field "id" int) (D.succeed idsMatch)
Edit: See Atlewee’s post for an