autodocodec 0.2.0.3 → 0.2.0.4
raw patch · 4 files changed
+18/−4 lines, 4 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Autodocodec.Class: instance Autodocodec.Class.HasCodec a => Autodocodec.Class.HasCodec (Data.Functor.Identity.Identity a)
Files
- CHANGELOG.md +6/−0
- autodocodec.cabal +4/−4
- src/Autodocodec/Class.hs +6/−0
- src/Autodocodec/Codec.hs +2/−0
CHANGELOG.md view
@@ -1,5 +1,11 @@ # Changelog +## [0.2.0.4] - 2023-07-31++### Added++* The `HasCodec Identity` instance, thanks @clintonmead!+ ## [0.2.0.3] - 2023-01-31 ### Added
autodocodec.cabal view
@@ -1,17 +1,17 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.34.7.+-- This file has been generated from package.yaml by hpack version 0.35.2. -- -- see: https://github.com/sol/hpack name: autodocodec-version: 0.2.0.3+version: 0.2.0.4 synopsis: Self-documenting encoder and decoder homepage: https://github.com/NorfairKing/autodocodec#readme bug-reports: https://github.com/NorfairKing/autodocodec/issues author: Tom Sydney Kerckhove maintainer: syd@cs-syd.eu-copyright: 2021-2022 Tom Sydney Kerckhove+copyright: 2021-2023 Tom Sydney Kerckhove license: MIT license-file: LICENSE build-type: Simple@@ -64,8 +64,8 @@ build-depends: base >=4.7 && <5 , doctest+ default-language: Haskell2010 if impl(GHC < 9.0) buildable: True else buildable: False- default-language: Haskell2010
src/Autodocodec/Class.hs view
@@ -4,6 +4,8 @@ {-# LANGUAGE OverloadedLists #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-}+-- Because Eq is a superclass of Hashable in newer versions.+{-# OPTIONS_GHC -Wno-redundant-constraints #-} module Autodocodec.Class where @@ -13,6 +15,7 @@ #if MIN_VERSION_aeson(2,0,0) import Data.Aeson.KeyMap (KeyMap) #endif+import Data.Functor.Identity import Data.HashMap.Strict (HashMap) import Data.Hashable (Hashable) import Data.Int@@ -105,6 +108,9 @@ instance HasCodec JSON.Value where codec = ValueCodec++instance HasCodec a => HasCodec (Identity a) where+ codec = dimapCodec runIdentity Identity codec instance HasCodec a => HasCodec (Maybe a) where codec = maybeCodec codec
src/Autodocodec/Codec.hs view
@@ -10,6 +10,8 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TypeApplications #-}+-- Because Eq is a superclass of Hashable in newer versions.+{-# OPTIONS_GHC -Wno-redundant-constraints #-} module Autodocodec.Codec where