r/programming • • Dec 08 '19

JSON Decoding in Elm

https://functional.christmas/2019/8
73 Upvotes

56 comments sorted by

View all comments

Show parent comments

1

u/XzwordfeudzX Dec 08 '19

Sure, when it's an identity function it's tedious (but there are websites that can generate the decoders in those cases). However, my experience is not that 80% are identity functions, it's closer to 10%. When I used Haskell, I would often "cheat" and accept an inadequate data structure for the business logic so Haskell could generate the data structures instead of writing my own decoders.

4

u/delrindude Dec 08 '19

I've had the opposite experience, I would use automatic derivation everywhere, then immediately transform my data structures to business logic ones. Never once have I written my own decoder/encoder.