It can take a bit of time to wrap your head around how JSON decoders work. Especially functions like Json.Decode.andThen take a bit of practice to ...
For further actions, you may consider blocking this person and/or reporting abuse
Great write up! Thank you very much for sharing your experience with us.
I cached two errors when trying your code in Ellie.
individualDecoder
should be like this:addIfPet
function should be like this:I made the change accordingly in my Ellie and print some debug info on screen to visualize the decoding and converting process
Amazing, thank you! Would you be okay if I linked your Ellie instead of mine from the post? I'll attribute it to you of course!
Sure, That's totally fine. I'm glad it helped.
Hi, the article is great, and explains so much.
Did you thought about replacing
with
I think it would be nice to just stress that out. It clears the function a bit more.
Cheers :)
Hey, thanks for reading! Yeah, your way is what I usually do in code I write. I was a bit on the fence about the style to use in this post, and ended up deciding for the lambda because I thought that might be more accessible, although that is entirely debatable :).