on master help sign in
Remove deprecated withNumber, use withScientific instead
commit161f14d41cd8f11917a04c4b625138022a601cef authorAdam Bergmark <adam@bergmark.nl> dateFri 8 Jun 2018, 15:29 (8 years ago) parent64715d4
5 files changed+4−11
Data/Aeson.hs−1 Data/Aeson/Types.hs−1 Data/Aeson/Types/Class.hs−1 Data/Aeson/Types/FromJSON.hs−8 changelog.md+4
Data/Aeson.hs−1
@@ -113,7 +113,6 @@ module Data.Aeson
113113 , withObject
114114 , withText
115115 , withArray
116− , withNumber
117116 , withScientific
118117 , withBool
119118 , withEmbeddedJSON
Data/Aeson/Types.hs−1
@@ -81,7 +81,6 @@ module Data.Aeson.Types
8181 , withObject
8282 , withText
8383 , withArray
84− , withNumber
8584 , withScientific
8685 , withBool
8786 , withEmbeddedJSON
Data/Aeson/Types/Class.hs−1
@@ -70,7 +70,6 @@ module Data.Aeson.Types.Class
7070 , withObject
7171 , withText
7272 , withArray
73− , withNumber
7473 , withScientific
7574 , withBool
7675 , withEmbeddedJSON
Data/Aeson/Types/FromJSON.hs−8
@@ -52,7 +52,6 @@ module Data.Aeson.Types.FromJSON
5252 , withObject
5353 , withText
5454 , withArray
55− , withNumber
5655 , withScientific
5756 , withBool
5857 , withEmbeddedJSON
@@ -646,13 +645,6 @@ withArray _ f (Array arr) = f arr
646645withArray expected _ v = typeMismatch expected v
647646{-# INLINE withArray #-}
648647
649−-- | @'withNumber' expected f value@ applies @f@ to the 'Number' when @value@
650−-- is a 'Number' and fails using @'typeMismatch' expected@ otherwise.
651−withNumber :: String -> (Number -> Parser a) -> Value -> Parser a
652−withNumber expected f = withScientific expected (f . scientificToNumber)
653−{-# INLINE withNumber #-}
654−{-# DEPRECATED withNumber "Use withScientific instead" #-}
655−
656648-- | @'withScientific' expected f value@ applies @f@ to the 'Scientific' number
657649-- when @value@ is a 'Number' and fails using @'typeMismatch' expected@
658650-- otherwise.
changelog.md+4
@@ -1,5 +1,9 @@
11For the latest version of this document, please see [https://github.com/bos/aeson/blob/master/changelog.md](https://github.com/bos/aeson/blob/master/changelog.md).
22
3+### 1.4.0.0 (upcoming)
4+
5+* Remove deprecated `withNumber`, use `withScientific` instead.
6+
37### 1.3.1.1
48
59* Catch 0 denominators when parsing Ratio