packages feed

aeson-utils 0.2.1.1 → 0.2.2.0

raw patch · 3 files changed

+10/−8 lines, 3 filesdep ~scientificPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: scientific

API changes (from Hackage documentation)

+ Data.Aeson.Utils: floatingOrInteger :: (RealFloat r, Integral i) => Scientific -> Either r i

Files

CHANGELOG.md view
@@ -1,5 +1,10 @@ # Changelog +#### 0.2.2.0++* Deprecate `parseNumber` in favor of `Data.Scientific.floatingOrInteger`+* Re-export `Data.Scientific.floatingOrInteger`+ #### 0.2.1.1  * Allow `scientific 0.3.*`
aeson-utils.cabal view
@@ -1,5 +1,5 @@ name:                aeson-utils-version:             0.2.1.1+version:             0.2.2.0 synopsis:            Utilities for working with Aeson. description:         Utilities for working with Aeson. license:             BSD3@@ -30,5 +30,5 @@     , aeson >= 0.6 && < 0.8     , attoparsec >= 0.10 && < 0.12     , bytestring >= 0.9 && < 0.11-    , scientific >= 0.2 && < 0.4+    , scientific >= 0.3.2 && < 0.4     , text >= 0.11 && < 1.2
src/Data/Aeson/Utils.hs view
@@ -10,6 +10,7 @@   , fromFloatDigits   , (.=?)   , parseNumber+  , floatingOrInteger   ) where  import Data.Aeson@@ -45,9 +46,5 @@ -- | Convert a Scientific into an Integer if it doesn't have decimal points, -- otherwise to a Double. parseNumber :: Scientific -> Either Integer Double-parseNumber n-    | e >= 0    = Left $ c * 10 ^ e-    | otherwise = Right $ realToFrac n-  where-    e = base10Exponent n-    c = coefficient n+parseNumber = either Right Left . floatingOrInteger+{-# DEPRECATED parseNumber "Use Data.Scientific.floatingOrInteger instead" #-}