Open phadej opened 7 years ago
There's http://hackage.haskell.org/package/aeson-value-parser-0.12.2/docs/Aeson-ValueParser.html, which implements this idea but goes further (it defines different monads for parsing objects, values, etc). I haven't used aeson-value-parser myself but I think it provides a much better API than Aeson.
introduce new
Parser'
(name open to bikeshedding)This will allow to modify
FromJSON
(in backward compatible way):Having
Parser'
will be a little more ergonomic, e.g. forPrime version
Parser'
would require own variants ofwithObject
OTOH, they aren't really required as
Note:
In case this is bad idea, let's document why. Or is it already somewhere?