Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Generalize the representation of numbers #78

Closed
shawjef3 opened this Issue · 2 comments

2 participants

@shawjef3

The JSON spec does not specify the data types to be used for numbers, just their grammar. This allows for fixed precision decimal numbers, which Aeson does not support. Much flexibility could be gained from switching numbers to something like

data Number = Number { significantDigits :: ByteString, Decimal :: ByteString, exponent :: ByteString }

This way, it would be up to the user of Aeson what type they want to use for their numbers.

Jeff

@shawjef3

I'm seeing that other JSON libraries are using Rational, which makes sense.

@bos
Owner

Not super interested in supporting this, because adding generality will reduce performance.

@bos bos closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.