hw-aeson 0.1.7.0 → 0.1.8.0
raw patch · 3 files changed
+14/−2 lines, 3 filesdep ~aesondep ~textPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aeson, text
API changes (from Hackage documentation)
Files
- hw-aeson.cabal +2/−2
- src/HaskellWorks/Data/Aeson/Compat.hs +4/−0
- src/HaskellWorks/Data/Aeson/Compat/Map/V2.hs +8/−0
hw-aeson.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.2 name: hw-aeson-version: 0.1.7.0+version: 0.1.8.0 synopsis: Convenience functions for Aeson description: Convenience functions for Aeson. category: Data, JSON@@ -22,7 +22,7 @@ common base { build-depends: base >= 4.11 && < 5 } -common aeson { build-depends: aeson >= 1.4 && < 2.1 }+common aeson { build-depends: aeson >= 1.4 && < 2.2 } common bytestring { build-depends: bytestring >= 0.10 && < 0.12 } common containers { build-depends: containers >= 0.6 && < 0.7 } common doctest { build-depends: doctest >= 0.16.2 && < 0.21 }
src/HaskellWorks/Data/Aeson/Compat.hs view
@@ -55,6 +55,8 @@ shortTextToKey :: ShortText -> Key #if MIN_VERSION_aeson(2,0,0)+shortTextToKey = J.fromText . ST.toText+#elif MIN_VERSION_aeson(2,0,2) shortTextToKey = J.fromShortText #else shortTextToKey = ST.toText@@ -62,6 +64,8 @@ keyToShortText :: Key -> ShortText #if MIN_VERSION_aeson(2,0,0)+keyToShortText = ST.fromText . J.toText+#elif MIN_VERSION_aeson(2,0,2) keyToShortText = J.toShortText #else keyToShortText = ST.fromText
src/HaskellWorks/Data/Aeson/Compat/Map/V2.hs view
@@ -135,7 +135,11 @@ toAscList = M.toList . toMap elems :: KeyMap v -> [v]+#if MIN_VERSION_aeson(2,0,3) elems = KM.elems+#else+elems = M.elems . KM.toMap+#endif fromHashMap :: HashMap Key v -> KeyMap v fromHashMap = KM.fromHashMap@@ -165,7 +169,11 @@ map = KM.map mapWithKey :: (Key -> a -> b) -> KeyMap a -> KeyMap b+#if MIN_VERSION_aeson(2,1,0)+mapWithKey = KM.mapWithKey+#else mapWithKey f = KM.fromMap . M.mapWithKey f . KM.toMap+#endif traverseWithKey :: Applicative f => (Key -> v1 -> f v2) -> KeyMap v1 -> f (KeyMap v2) traverseWithKey = KM.traverseWithKey