packages feed

deriving-aeson 0.2.1 → 0.2.2

raw patch · 4 files changed

+13/−1 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Deriving.Aeson: data UnwrapUnaryRecords
+ Deriving.Aeson: instance Deriving.Aeson.AesonOptions xs => Deriving.Aeson.AesonOptions (Deriving.Aeson.UnwrapUnaryRecords : xs)

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for deriving-aeson +## 0.2.2++* Added `UnwrapUnaryRecords`+ ## 0.2.1  * Remove redundant type variables from `Sum*`
README.md view
@@ -5,6 +5,8 @@ ![Haskell CI](https://github.com/fumieval/deriving-aeson/workflows/Haskell%20CI/badge.svg) [![Discord](https://img.shields.io/discord/664807830116892674?color=%237095ec&label=Discord&style=plastic)](https://discord.gg/DG93Tgs) +![logo](https://github.com/fumieval/deriving-aeson/blob/master/logo/logo.png?raw=true)+ This package provides a newtype wrapper where you can customise [aeson](https://hackage.haskell.org/package/aeson)'s generic methods using a type-level interface, which synergises well with DerivingVia.
deriving-aeson.cabal view
@@ -1,6 +1,6 @@ cabal-version:       2.4 name:                deriving-aeson-version:             0.2.1+version:             0.2.2 synopsis:            Type driven generic aeson instance customisation description:         This package provides a newtype wrapper with   FromJSON/ToJSON instances customisable via a phantom type parameter.
src/Deriving/Aeson.hs view
@@ -17,6 +17,7 @@   , OmitNothingFields   , TagSingleConstructors   , NoAllNullaryToStringTag+  , UnwrapUnaryRecords   -- * Sum encoding   , SumTaggedObject   , SumUntaggedValue@@ -71,6 +72,8 @@ -- | the encoding will always follow the 'sumEncoding'. data NoAllNullaryToStringTag +data UnwrapUnaryRecords+ -- | Strip prefix @t@. If it doesn't have the prefix, keep it as-is. data StripPrefix t @@ -108,6 +111,9 @@  instance AesonOptions '[] where   aesonOptions = defaultOptions++instance AesonOptions xs => AesonOptions (UnwrapUnaryRecords ': xs) where+  aesonOptions = (aesonOptions @xs) { unwrapUnaryRecords = True }  instance AesonOptions xs => AesonOptions (OmitNothingFields ': xs) where   aesonOptions = (aesonOptions @xs) { omitNothingFields = True }