json
json copied to clipboard
Add function to decode the contetns of a JSON string with another decoder
Closes #33
Maybe it would be worth discussing the exact API to publish.
I personally think it is fine to add a function like stringAs : Decoder a -> Decoder a
to the public API, I can see how it is rare to want to decode the string as anything but an integer or a float.
Because of that it might be a better idea to expose functions stringAsInt : Decoder Int
and stringAsFloat : Decoder Float
instead. Maybe alongside a generic stringAs
, to support weird use-cases?