Skip to content

Add JSON decode functions from Js.Json #16

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

Merged
merged 3 commits into from
Feb 9, 2023
Merged

Add JSON decode functions from Js.Json #16

merged 3 commits into from
Feb 9, 2023

Conversation

cknitt
Copy link
Member

@cknitt cknitt commented Feb 9, 2023

... and move classify into separate submodule + add .resi.

Merge #15 first.

Note: I made it Json.Decode.float (Js.Json calls it decodeNumber) and am not providing a Json.Decode.int on purpose.

@cknitt cknitt requested a review from zth February 9, 2023 09:07
@zth zth merged commit a45fcbf into main Feb 9, 2023
@zth zth deleted the json-decode branch February 9, 2023 09:14
Comment on lines +3 to +6
type jsonReviver
external asJsonReviver: 'a => jsonReviver = "%identity"
type jsonReplacer
external asJsonReplacer: 'a => jsonReplacer = "%identity"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of these? They look unsafe, but are not marked as such. And if they can really be anything, why not just allow anything to be passed directly?

Also, as I understand, jsonReviver can really only be a function. So why isn't it a function?

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.

3 participants