packages feed

aeson-value-parser 0.19.4.1 → 0.19.5

raw patch · 2 files changed

+8/−1 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ AesonValueParser: parseByteString :: Value a -> ByteString -> Either Text a

Files

aeson-value-parser.cabal view
@@ -1,5 +1,5 @@ name: aeson-value-parser-version: 0.19.4.1+version: 0.19.5 synopsis: API for parsing "aeson" JSON tree into Haskell types description:   A flexible parser DSL of JSON AST produced by the \"aeson\" library
library/AesonValueParser.hs view
@@ -8,6 +8,7 @@     run,     runWithTextError,     Error.Error (..),+    parseByteString,      -- * Value parsers     object,@@ -107,6 +108,12 @@  runString :: String a -> Text -> Either (Maybe Text) a runString (String a) b = first getLast (runExcept (runReaderT a b))++parseByteString :: Value a -> ByteString -> Either Text a+parseByteString p bs =+  case Aeson.eitherDecodeStrict' bs of+    Right aeson -> runWithTextError p aeson+    Left stringErr -> Left (fromString stringErr)  -- ** Definitions