aeson v1.4.0.0 Release Notes

  • ๐Ÿš€ This release introduces bounds on the size of Scientific numbers when they are converted to other arbitrary precision types that do not represent them efficiently in memory.

    ๐Ÿ“œ This means that trying to decode a number such as 1e1000000000 into an Integer will now fail instead of using a lot of memory. If you need to represent large numbers you can add a newtype (preferably over Scientific) and providing a parser using withScientific.

    The following instances are affected by this:

    • FromJSON Natural
    • FromJSONKey Natural
    • FromJSON Integer
    • FromJSONKey Integer
    • FromJSON NominalDiffTime

    ๐Ÿšš For the same reasons the following instances & functions have been removed:

    • โœ‚ Remove FromJSON Data.Attoparsec.Number instance. Note that Data.Attoparsec.Number is deprecated.
    • โœ‚ Remove deprecated withNumber, use withScientific instead.

    Finally, encoding integral values with large exponents now uses scientific notation, this saves space for large numbers.