garyb / purescript-codec-argonaut

Bi-directional JSON codecs for argonaut
MIT License
39 stars 16 forks source link

Make prismaticCodec decoder return either #57

Closed yaitskov closed 1 year ago

yaitskov commented 1 year ago

Type of decoder function used in prismaticCodec return Maybe, so reporting details about syntax error is not possible.

garyb commented 1 year ago

You may as well create a codec without the "prismatic" helper at that point, Codec.codec' is (Json -> Either JsonDecodeError a) -> (a -> Json) -> JsonCodec a when used for a JsonCodec.