smash-aeson 0.1.0.0 → 0.2.0.1
raw patch · 5 files changed
+54/−43 lines, 5 filesdep ~aesondep ~basedep ~smashPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aeson, base, smash
API changes (from Hackage documentation)
Files
- CHANGELOG.md +8/−0
- smash-aeson.cabal +31/−28
- src/Data/Can/Aeson.hs +5/−5
- src/Data/Smash/Aeson.hs +5/−5
- src/Data/Wedge/Aeson.hs +5/−5
CHANGELOG.md view
@@ -1,5 +1,13 @@ # Revision history for smash-aeson +## 0.2.0.1 -- 2022-04-03++* Update `base` bounds to allow GHC 9.2.x++## 0.2.0.0 -- 2022-04-02++* Update `aeson` bounds to `>=2.0 && <2.1`+ ## 0.1.0.0 -- YYYY-mm-dd * First version. Released on an unsuspecting world.
smash-aeson.cabal view
@@ -1,37 +1,40 @@-cabal-version: 2.0---name: smash-aeson-version: 0.1.0.0-synopsis: Aeson support for the smash library-description:- Aeson support for the `smash` library-homepage: https://github.com/emilypi/smash-bug-reports: https://github.com/emilypi/smash/issues-license: BSD3-license-file: LICENSE-author: Emily Pillmore-maintainer: emilypi@cohomolo.gy-copyright: (c) 2020 Emily Pillmore <emilypi@cohomolo.gy>-category: Data-build-type: Simple+cabal-version: 2.0+name: smash-aeson+version: 0.2.0.1+synopsis: Aeson support for the smash library+description: Aeson support for the `smash` library+homepage: https://github.com/emilypi/smash+bug-reports: https://github.com/emilypi/smash/issues+license: BSD3+license-file: LICENSE+author: Emily Pillmore+maintainer: emilypi@cohomolo.gy+copyright: (c) 2020-2022 Emily Pillmore <emilypi@cohomolo.gy>+category: Data+build-type: Simple extra-source-files: CHANGELOG.md README.md tested-with:- GHC ==8.2.2 || ==8.4.3 || ==8.4.4 || ==8.6.3 || ==8.6.5 || ==8.8.3 || ==8.10.1+ GHC ==8.6.5+ || ==8.8.4+ || ==8.10.7+ || ==9.0.2+ || ==9.2.2 library- exposed-modules: Data.Can.Aeson- , Data.Smash.Aeson- , Data.Wedge.Aeson+ exposed-modules:+ Data.Can.Aeson+ Data.Smash.Aeson+ Data.Wedge.Aeson - build-depends: base >=4.10 && <5.0- , aeson ^>=1.4.7- , smash ^>=0.1.1- , unordered-containers+ build-depends:+ aeson >=2.0 && <2.1+ , base >=4.1 && <4.17+ , smash >=0.1.3+ , unordered-containers - hs-source-dirs: src- default-language: Haskell2010- ghc-options: -Wall+ hs-source-dirs: src+ default-language: Haskell2010+ ghc-options: -Wall
src/Data/Can/Aeson.hs view
@@ -3,7 +3,7 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} -- | -- Module : Data.Can.Aeson--- Copyright : (c) 2020 Emily Pillmore+-- Copyright : (c) 2020-2022 Emily Pillmore -- License : BSD-3-Clause -- -- Maintainer : Emily Pillmore <emilypi@cohomolo.gy>@@ -17,7 +17,7 @@ import Data.Aeson import Data.Aeson.Encoding (emptyObject_, pair)-import qualified Data.HashMap.Lazy as HM+import qualified Data.Aeson.KeyMap as KM import Data.Can (Can(..)) #if __GLASGOW_HASKELL__ < 804 import Data.Semigroup (Semigroup(..))@@ -36,7 +36,7 @@ toEncoding Non = emptyObject_ instance (FromJSON a, FromJSON b) => FromJSON (Can a b) where- parseJSON = withObject "Can a b" (go . HM.toList)+ parseJSON = withObject "Can a b" (go . KM.toList) where go [("One", a)] = One <$> parseJSON a go [("Eno", b)] = Eno <$> parseJSON b@@ -69,7 +69,7 @@ liftToEncoding _ _ Non = emptyObject_ instance FromJSON2 Can where- liftParseJSON2 f _ g _ = withObject "Can a b" (go . HM.toList)+ liftParseJSON2 f _ g _ = withObject "Can a b" (go . KM.toList) where go [] = pure Non go [("One", a)] = One <$> f a@@ -78,7 +78,7 @@ go _ = fail "Expected either empty object, or 'One' and 'Eno' keys, 'One' or 'Eno' keys only" instance FromJSON a => FromJSON1 (Can a) where- liftParseJSON f _ = withObject "Can a b" (go . HM.toList)+ liftParseJSON f _ = withObject "Can a b" (go . KM.toList) where go [] = pure Non go [("One", a)] = One <$> parseJSON a
src/Data/Smash/Aeson.hs view
@@ -3,7 +3,7 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} -- | -- Module : Data.Smash.Aeson--- Copyright : (c) 2020 Emily Pillmore+-- Copyright : (c) 2020-2022 Emily Pillmore -- License : BSD-3-Clause -- -- Maintainer : Emily Pillmore <emilypi@cohomolo.gy>@@ -18,7 +18,7 @@ import Data.Aeson import Data.Aeson.Encoding (emptyObject_, pair)-import qualified Data.HashMap.Lazy as HM+import qualified Data.Aeson.KeyMap as KM #if __GLASGOW_HASKELL__ < 804 import Data.Semigroup (Semigroup(..)) #endif@@ -33,7 +33,7 @@ toEncoding Nada = emptyObject_ instance (FromJSON a, FromJSON b) => FromJSON (Smash a b) where- parseJSON = withObject "Smash a b" (go . HM.toList)+ parseJSON = withObject "Smash a b" (go . KM.toList) where go [("SmashL", a), ("SmashR", b)] = Smash <$> parseJSON a <*> parseJSON b go [] = pure Nada@@ -56,14 +56,14 @@ liftToEncoding _ _ Nada = emptyObject_ instance FromJSON2 Smash where- liftParseJSON2 f _ g _ = withObject "Smash a b" (go . HM.toList)+ liftParseJSON2 f _ g _ = withObject "Smash a b" (go . KM.toList) where go [] = pure Nada go [("SmashL", a), ("SmashR", b)] = Smash <$> f a <*> g b go _ = fail "Expected either empty object, or a 'Smash' pair" instance FromJSON a => FromJSON1 (Smash a) where- liftParseJSON f _ = withObject "Smash a b" (go . HM.toList)+ liftParseJSON f _ = withObject "Smash a b" (go . KM.toList) where go [] = pure Nada go [("SmashL", a), ("SmashR", b)] = Smash <$> parseJSON a <*> f b
src/Data/Wedge/Aeson.hs view
@@ -2,7 +2,7 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} -- | -- Module : Data.Wedge.Aeson--- Copyright : (c) 2020 Emily Pillmore+-- Copyright : (c) 2020-2022 Emily Pillmore -- License : BSD-3-Clause -- -- Maintainer : Emily Pillmore <emilypi@cohomolo.gy>@@ -16,7 +16,7 @@ import Data.Aeson import Data.Aeson.Encoding (emptyObject_, pair)-import qualified Data.HashMap.Lazy as HM+import qualified Data.Aeson.KeyMap as KM import Data.Wedge (Wedge(..)) @@ -30,7 +30,7 @@ toEncoding Nowhere = emptyObject_ instance (FromJSON a, FromJSON b) => FromJSON (Wedge a b) where- parseJSON = withObject "Wedge a b" (go . HM.toList)+ parseJSON = withObject "Wedge a b" (go . KM.toList) where go [("Here", a)] = Here <$> parseJSON a go [("There", b)] = There <$> parseJSON b@@ -58,7 +58,7 @@ liftToEncoding _ _ Nowhere = emptyObject_ instance FromJSON2 Wedge where- liftParseJSON2 f _ g _ = withObject "Wedge a b" (go . HM.toList)+ liftParseJSON2 f _ g _ = withObject "Wedge a b" (go . KM.toList) where go [] = pure Nowhere go [("Here", a)] = Here <$> f a@@ -66,7 +66,7 @@ go _ = fail "Expected either empty object, or one with 'Here' or 'There' keys only" instance FromJSON a => FromJSON1 (Wedge a) where- liftParseJSON f _ = withObject "Wedge a b" (go . HM.toList)+ liftParseJSON f _ = withObject "Wedge a b" (go . KM.toList) where go [] = pure Nowhere go [("Here", a)] = Here <$> parseJSON a