hw-aeson 0.1.4.0 → 0.1.5.0
raw patch · 2 files changed
+19/−5 lines, 2 filesdep +containersPVP ok
version bump matches the API change (PVP)
Dependencies added: containers
API changes (from Hackage documentation)
+ HaskellWorks.Data.Aeson.Compat.Map: data KeyMap v
+ HaskellWorks.Data.Aeson.Compat.Map: foldlWithKey' :: (a -> Key -> b -> a) -> a -> KeyMap b -> a
Files
hw-aeson.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.2 name: hw-aeson-version: 0.1.4.0+version: 0.1.5.0 synopsis: Convenience functions for Aeson description: Convenience functions for Aeson. category: Data, JSON@@ -22,9 +22,10 @@ common base { build-depends: base >= 4.11 && < 5 } +common aeson { build-depends: aeson >= 1.4 && < 2.1 }+common containers { build-depends: containers >= 0.6 && < 0.7 } common doctest { build-depends: doctest >= 0.16.2 && < 0.21 } common doctest-discover { build-depends: doctest-discover >= 0.2 && < 0.3 }-common aeson { build-depends: aeson >= 1.4 && < 2.1 } common hedgehog { build-depends: hedgehog >= 0.6 && < 1.3 } common hspec { build-depends: hspec >= 2.4 && < 3 } common text { build-depends: text >= 1.2 && < 1.3 }@@ -39,6 +40,7 @@ library import: base, config , aeson+ , containers , text , text-short , unordered-containers
src/HaskellWorks/Data/Aeson/Compat/Map.hs view
@@ -2,18 +2,30 @@ module HaskellWorks.Data.Aeson.Compat.Map ( module JM+ , KeyMap(..)+ , foldlWithKey' ) where +import qualified Data.Map as M+import qualified HaskellWorks.Data.Aeson.Compat as J+ import Data.Text (Text) #if MIN_VERSION_aeson(2,0,0) import Data.Aeson.KeyMap as JM #else-import Data.HashMap.Strict as JM+import qualified Data.HashMap.Strict as JM+import Data.HashMap.Strict hiding (foldlWithKey') #endif +#if !MIN_VERSION_aeson(2,0,0)+type KeyMap v = JM.HashMap Text v+#endif++foldlWithKey' :: (a -> J.Key -> b -> a) -> a -> KeyMap b -> a #if MIN_VERSION_aeson(2,0,0)-type Map v = JM.KeyMap v+foldlWithKey' f a = M.foldlWithKey' f a . JM.toMap #else-type Map v = JM.HashMap Text v+foldlWithKey'= JM.foldlWithKey' #endif+