packages feed

lens-aeson 1.2.2 → 1.2.3

raw patch · 3 files changed

+12/−12 lines, 3 filesdep −attoparsecdep ~aesondep ~bytestringdep ~textPVP ok

version bump matches the API change (PVP)

Dependencies removed: attoparsec

Dependency ranges changed: aeson, bytestring, text

API changes (from Hackage documentation)

Files

CHANGELOG.markdown view
@@ -1,3 +1,9 @@+1.2.3 [2023.06.27]+------------------+* Use `aeson`'s `decode` function in the `AsJSON` instance for `ByteString`s.+  This allows removing a direct dependency on `attoparsec`.+* Allow building with `aeson-2.2`.+ 1.2.2 [2022.08.11] ------------------ * Add `atKey :: AsValue t => Key -> Traversal' t (Maybe Value)`, a variant of
lens-aeson.cabal view
@@ -1,6 +1,6 @@ name:          lens-aeson category:      Data, JSON, Lenses-version:       1.2.2+version:       1.2.3 license:       MIT cabal-version: >= 1.10 license-file:  LICENSE@@ -20,7 +20,9 @@              , GHC == 8.8.4              , GHC == 8.10.7              , GHC == 9.0.2-             , GHC == 9.2.2+             , GHC == 9.2.7+             , GHC == 9.4.5+             , GHC == 9.6.2 synopsis:      Law-abiding lenses for aeson description:   Law-abiding lenses for aeson. @@ -44,9 +46,8 @@     text-short           >= 0.1.4     && < 0.2,     vector               >= 0.9       && < 0.14,     unordered-containers >= 0.2.3     && < 0.3,-    attoparsec           >= 0.10      && < 0.15,     bytestring           >= 0.9       && < 0.12,-    aeson                >= 2.0.2     && < 2.2,+    aeson                >= 2.0.2     && < 2.3,     scientific           >= 0.3.2     && < 0.4    exposed-modules:
src/Data/Aeson/Lens.hs view
@@ -53,8 +53,6 @@ import qualified Data.Aeson.Key    as Key import qualified Data.Aeson.KeyMap as KM import Data.Aeson.KeyMap (KeyMap)-import Data.Aeson.Parser (value)-import Data.Attoparsec.ByteString.Lazy (maybeResult, parse) import Data.Scientific (Scientific) import qualified Data.Scientific as Scientific import qualified Data.ByteString as Strict@@ -408,12 +406,7 @@   {-# INLINE _JSON #-}  instance AsJSON Lazy.ByteString where-  _JSON = prism' encode decodeValue-    where-      decodeValue :: (FromJSON a) => Lazy.ByteString -> Maybe a-      decodeValue s = maybeResult (parse value s) >>= \x -> case fromJSON x of-        Success v -> Just v-        _         -> Nothing+  _JSON = prism' encode decode   {-# INLINE _JSON #-}  instance AsJSON String where