We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
A consequence of the Rational encoding for numbers is that -0.0 :: Float can't be represented:
Rational
-0.0 :: Float
Prelude Text.JSON> readJSON (showJSON (-0 :: Float)) :: Result Float Ok 0.0
Most JSON libraries do seem to have decided to roundtrip that correctly, e.g.:
ChaiScript/ChaiScript#334 google/gson#1053 https://www.ietf.org/mail-archive/web/json/current/msg03670.html
but it's not totally unambiguous, e.g.:
https://www.ietf.org/mail-archive/web/json/current/msg03927.html
Given that Rational is normalised on construction and can't represent negative zero, I don't think there's an easy fix though.
The text was updated successfully, but these errors were encountered:
FWIW aeson also doesn't roundtrip -0.0, though it does print it correctly so presumably its data representation (Scientific) can handle it.
aeson
Scientific
Sorry, something went wrong.
No branches or pull requests
A consequence of the
Rational
encoding for numbers is that-0.0 :: Float
can't be represented:Most JSON libraries do seem to have decided to roundtrip that correctly, e.g.:
ChaiScript/ChaiScript#334
google/gson#1053
https://www.ietf.org/mail-archive/web/json/current/msg03670.html
but it's not totally unambiguous, e.g.:
https://www.ietf.org/mail-archive/web/json/current/msg03927.html
Given that
Rational
is normalised on construction and can't represent negative zero, I don't think there's an easy fix though.The text was updated successfully, but these errors were encountered: