Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kintrix007
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add function to parse JSON string as a number instead. ("42" -> 42)
1 participant