json icon indicating copy to clipboard operation
json copied to clipboard

Add function to decode the contetns of a JSON string with another decoder

Open kintrix007 opened this issue 8 months ago • 0 comments

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?

kintrix007 avatar Jun 12 '24 11:06 kintrix007