deriving-aeson 0.2 → 0.2.1
raw patch · 4 files changed
+10/−5 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Deriving.Aeson: instance (GHC.TypeLits.KnownSymbol t, GHC.TypeLits.KnownSymbol c, Deriving.Aeson.AesonOptions xs) => Deriving.Aeson.AesonOptions (Deriving.Aeson.SumObjectWithSingleField : xs)
- Deriving.Aeson: instance (GHC.TypeLits.KnownSymbol t, GHC.TypeLits.KnownSymbol c, Deriving.Aeson.AesonOptions xs) => Deriving.Aeson.AesonOptions (Deriving.Aeson.SumTwoElemArray : xs)
- Deriving.Aeson: instance (GHC.TypeLits.KnownSymbol t, GHC.TypeLits.KnownSymbol c, Deriving.Aeson.AesonOptions xs) => Deriving.Aeson.AesonOptions (Deriving.Aeson.SumUntaggedValue : xs)
+ Deriving.Aeson: instance Deriving.Aeson.AesonOptions xs => Deriving.Aeson.AesonOptions (Deriving.Aeson.SumObjectWithSingleField : xs)
+ Deriving.Aeson: instance Deriving.Aeson.AesonOptions xs => Deriving.Aeson.AesonOptions (Deriving.Aeson.SumTwoElemArray : xs)
+ Deriving.Aeson: instance Deriving.Aeson.AesonOptions xs => Deriving.Aeson.AesonOptions (Deriving.Aeson.SumUntaggedValue : xs)
Files
- CHANGELOG.md +4/−0
- README.md +1/−0
- deriving-aeson.cabal +2/−2
- src/Deriving/Aeson.hs +3/−3
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for deriving-aeson +## 0.2.1++* Remove redundant type variables from `Sum*`+ ## 0.2 * Added `Sum*` for changing the encoding of variants
README.md view
@@ -35,6 +35,7 @@ * `Prefixed str` = `CustomJSON '[FieldLabelModifier (StripPrefix str)]` * `PrefixedSnake str` = `CustomJSON '[FieldLabelModifier (StripPrefix str, CamelToSnake)]` * `Snake` = `CustomJSON '[FieldLabelModifier (StripPrefix str, CamelToSnake)]`+* `Vanilla` = `CustomJSON '[]` How it works ----
deriving-aeson.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: deriving-aeson-version: 0.2+version: 0.2.1 synopsis: Type driven generic aeson instance customisation description: This package provides a newtype wrapper with FromJSON/ToJSON instances customisable via a phantom type parameter.@@ -25,7 +25,7 @@ build-depends: base >= 4.12 && <5, aeson >= 1.3 && <1.5 hs-source-dirs: src default-language: Haskell2010- ghc-options: -Wall+ ghc-options: -Wall -Wcompat test-suite test type: exitcode-stdio-1.0
src/Deriving/Aeson.hs view
@@ -127,11 +127,11 @@ instance (KnownSymbol t, KnownSymbol c, AesonOptions xs) => AesonOptions (SumTaggedObject t c ': xs) where aesonOptions = (aesonOptions @xs) { sumEncoding = TaggedObject (symbolVal (Proxy @ t)) (symbolVal (Proxy @ t)) } -instance (KnownSymbol t, KnownSymbol c, AesonOptions xs) => AesonOptions (SumUntaggedValue ': xs) where+instance (AesonOptions xs) => AesonOptions (SumUntaggedValue ': xs) where aesonOptions = (aesonOptions @xs) { sumEncoding = UntaggedValue } -instance (KnownSymbol t, KnownSymbol c, AesonOptions xs) => AesonOptions (SumObjectWithSingleField ': xs) where+instance (AesonOptions xs) => AesonOptions (SumObjectWithSingleField ': xs) where aesonOptions = (aesonOptions @xs) { sumEncoding = ObjectWithSingleField } -instance (KnownSymbol t, KnownSymbol c, AesonOptions xs) => AesonOptions (SumTwoElemArray ': xs) where+instance (AesonOptions xs) => AesonOptions (SumTwoElemArray ': xs) where aesonOptions = (aesonOptions @xs) { sumEncoding = ObjectWithSingleField }