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 anInteger
will now fail instead of using a lot of memory. If you need to represent large numbers you can add a newtype (preferably overScientific
) and providing a parser usingwithScientific
.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 thatData.Attoparsec.Number
is deprecated. - โ Remove deprecated
withNumber
, usewithScientific
instead.
Finally, encoding integral values with large exponents now uses scientific notation, this saves space for large numbers.