packages feed

autodocodec-exact 0.0.0.0 → 0.0.0.1

raw patch · 3 files changed

+17/−11 lines, 3 filesdep ~autodocodec

Dependency ranges changed: autodocodec

Files

CHANGELOG.md view
@@ -1,2 +1,7 @@ # Changelog +## [0.0.0.1] - 2025-06-20++### Changed++* Lower bound on `autodocodec >=0.5`
autodocodec-exact.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           autodocodec-exact-version:        0.0.0.0+version:        0.0.0.1 synopsis:       Exact decoder for autodocodec homepage:       https://github.com/NorfairKing/autodocodec#readme bug-reports:    https://github.com/NorfairKing/autodocodec/issues@@ -33,7 +33,7 @@   build-depends:       aeson     , aeson-pretty-    , autodocodec+    , autodocodec >=0.5.0.0     , base >=4.7 && <5     , bytestring     , containers
src/Autodocodec/Exact.hs view
@@ -300,15 +300,16 @@       Just (codecName, c) ->         withContext (ExactParseContextPieceDiscriminator discriminator codecName) $           goO value c-  RequiredKeyCodec k c mDoc -> do-    let key = Compat.toKey k-    case Compat.lookupKey key value of-      Nothing -> exactError $ ExactParseErrorMissingRequiredKey key value-      Just v ->-        withContext (ExactParseContextPieceKey key mDoc) $ do-          recogniseKey key-          liftValueParser $-            goV v c+  RequiredKeyCodec k c mDoc ->+    coerce $ do+      let key = Compat.toKey k+      case Compat.lookupKey key value of+        Nothing -> exactError $ ExactParseErrorMissingRequiredKey key value+        Just v ->+          withContext (ExactParseContextPieceKey key mDoc) $ do+            recogniseKey key+            liftValueParser $+              goV v c   OptionalKeyCodec k c mDoc ->     coerce $ do       let key = Compat.toKey k