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

Encode/Decode Natural #95

Closed
f-f opened this issue Dec 25, 2020 · 1 comment
Closed

Encode/Decode Natural #95

f-f opened this issue Dec 25, 2020 · 1 comment

Comments

@f-f
Copy link

f-f commented Dec 25, 2020

Would a PR to implement EncodeJson/DecodeJson for Natural be welcome?

@thomashoneyman
Copy link
Contributor

Unfortunately, since Natural is outside of core / contrib we won't bring in the dependency here. If you're using automatic record decoding that's unfortunate, but if you're manually writing encoders / decoders you could decode as an int and then immediately parse as a natural -- something (hand-wavy) like thisS

myField <- note (TypeMismatch "Natural") Natural.parse =<< rec .: "natural_field"

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

No branches or pull requests

2 participants