registry-aeson 0.2.1.0 → 0.2.2.0
raw patch · 4 files changed
+9/−11 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- README.md +7/−7
- registry-aeson.cabal +2/−2
- src/Data/Registry/Aeson/Decoder.hs +0/−1
- src/Data/Registry/Aeson/Encoder.hs +0/−1
README.md view
@@ -21,7 +21,7 @@ #### Example Here is an example of creating encoders for a set of related data types:-```+```haskell {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedLists #-}@@ -68,7 +68,7 @@ - retrieved from a `Aeson` instance: `jsonEncoder @Text`, `jsonEncoder @Int` Given the list of `encoders` an `Encoder Person` can be retrieved with:-```+```haskell let encoderPerson = make @(Encoder Person) encoders let encoded = encodeValue encoderPerson (Person (Identifier 123) (Email "me@here.com")) :: Value ```@@ -84,7 +84,7 @@ #### Example Here is an example of creating decoders for a set of related data types:-```+```haskell {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedLists #-}@@ -134,7 +134,7 @@ - retrieved from a `Aeson` instance: `jsonDecoder @Text`, `jsonDecoder @Int` Given the list of `Decoders` an `Decoder Person` can be retrieved with:-```+```haskell let decoderPerson = make @(Decoder Person) decoders let decoded = decode decoderPerson $ ObjectArray [Number 123, ObjectStr "me@here.com"] ```@@ -144,7 +144,7 @@ There is a bit of flexibility in the way encoders are created with TemplateHaskell. A custom `ConstructorsEncoder` can be added to the registry to tweak the generation:-```+```haskell newtype ConstructorEncoder = ConstructorEncoder { encodeConstructor :: Options -> FromConstructor -> (Value, Encoding) }@@ -157,7 +157,7 @@ #### Generated decoders The `makeDecoder` function makes the following functions:-```+```haskell -- makeDecoder ''Identifier \(d::Decoder Int) -> Decoder $ \o -> Identifier <$> decode d o @@ -184,7 +184,7 @@ There is a bit of flexibility in the way decoders are created with TemplateHaskell. A custom `ConstructorsDecoder` can be added to the registry to tweak the generation:-```+```haskell newtype ConstructorsDecoder = ConstructorsDecoder { decodeConstructors :: Options -> [ConstructorDef] -> Value -> Either Text [ToConstructor] }
registry-aeson.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.34.4.+-- This file has been generated from package.yaml by hpack version 0.35.0. -- -- see: https://github.com/sol/hpack name: registry-aeson-version: 0.2.1.0+version: 0.2.2.0 synopsis: Aeson encoders / decoders description: This library provides encoders / decoders which can be easily customized for the Aeson format. category: Data
src/Data/Registry/Aeson/Decoder.hs view
@@ -22,7 +22,6 @@ import Data.List ((\\)) import Data.Registry import Data.Registry.Aeson.TH.Decoder-import Data.Registry.Internal.Types hiding (Value) import qualified Data.Text as T import qualified Data.Text.Encoding as T import qualified Data.Vector as Vector
src/Data/Registry/Aeson/Encoder.hs view
@@ -22,7 +22,6 @@ import Data.Functor.Contravariant import Data.Registry import Data.Registry.Aeson.TH.Encoder-import Data.Registry.Internal.Types hiding (Value) import qualified Data.Vector as V import Protolude hiding (Type, list)