aeson-combinators 0.0.1.0 → 0.0.1.1
raw patch · 3 files changed
+27/−17 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +6/−1
- aeson-combinators.cabal +5/−1
- lib/Data/Aeson/Combinators/Decode.hs +16/−15
CHANGELOG.md view
@@ -1,5 +1,10 @@ # Revision history for aeson-combinators -## 0.1.0.0 -- YYYY-mm-dd+## 0.0.0.1 -- 2020-03-01++* Fixes and improvements in documentation+* Add source-repository to cabal file++## 0.0.1.0 -- 2020-02-29 * First version. Released on an unsuspecting world.
aeson-combinators.cabal view
@@ -1,6 +1,6 @@ cabal-version: >=1.10 name: aeson-combinators-version: 0.0.1.0+version: 0.0.1.1 synopsis: Aeson combinators for dead simple JSON decoding description: This library defines low overhead value space `Decoder`@@ -59,3 +59,7 @@ , utf8-string ghc-options: -Wall default-language: Haskell2010++source-repository head+ type: git+ location: https://github.com/turboMaCk/aeson-combinators.git
lib/Data/Aeson/Combinators/Decode.hs view
@@ -52,7 +52,7 @@ , nullable -- *** Sequences , list, vector--- *** Hasmap+-- *** Hashmap , hashMapLazy, hashMapStrict -- *** Map , mapLazy, mapStrict@@ -162,7 +162,7 @@ -- $applicative ----- If you like elm style decoding you can avoid using 'FromJSON' type class all togher.+-- If you like elm style decoding you can avoid using 'FromJSON' type class altogher. -- -- > import Data.Text -- > import qualified Data.Aeson.Combinators.Decode as ACD@@ -185,12 +185,12 @@ -- | === JSON Decoder ----- A value that describes how values are decoded from JSON.+-- A value describing how other values are decoded from JSON. -- This type is an alternative to Aeson's 'FromJSON' instance implementation. -- -- Use 'decode', 'decode', 'eitherDecode', 'eitherDecode'' -- 'decodeStrict', 'decodeStrict'', 'eitherDecodeStrict' or 'eitherDecodeStrict''--- alternatives provided by this module for decoding from 'BytString'.+-- alternatives provided by this module for decoding from 'ByteString'. -- -- For decoding files use -- 'decodeFileStrict', 'decodeFileStrict''@@ -206,7 +206,7 @@ -- > >>> decode intToString "2" -- > Just "2" ----- __Applicateve to construct products__+-- __Applicative to construct products__ -- -- > stringIntPair :: Decoder (String, Int) -- > stringIntPair = (,) <$> index 0 string@@ -236,9 +236,9 @@ -- > else fail $ "Expected odd value, got " <> show val -- -- > >>> eitherDecode odd "3"--- > Left 3+-- > Right 3 -- > >>> eitherDecode odd "4"--- > Right "Error in $: Expected odd value, got 4"+-- > Left "Error in $: Expected odd value, got 4" newtype Decoder a = Decoder (Value -> Parser a) @@ -283,7 +283,7 @@ -- -- While 'auto' is universally usable for all primitive values, -- this library provides individual type constraint functions--- for decoding those values.+-- for decoding most common primitives and combinators for decoding larger structure from these primitives. auto :: FromJSON a => Decoder a auto = Decoder parseJSON {-# INLINE auto #-}@@ -512,8 +512,8 @@ -- Combinators -- | Decode JSON null to any value.--- This function is usefull if you have custom--- constructor which represented by null in JSONs.+-- This function is useful for decoding+-- constructors which represented by null in JSON. -- -- > data Codomain = NotSet | Foo | Bar -- >@@ -570,7 +570,7 @@ -- $jsonpath -- Combinators using Aeson's 'JSONPathElement' and 'JSONPath' types.--- This makes it possible to mix object keys and array index accessors.+-- This makes it possible to combine object keys and array index accessors. -- | Decode value from JSON structure. --@@ -601,10 +601,11 @@ -- $running ----- Following functions are evivalent to the one provided by Aeson.--- The only difference is versions provided by Aeson--- for with 'FromJSON' instances while these use 'Decoder' type--- instead.+-- Following functions are evivalent to ones provided by Aeson itself.+-- The only difference is that versions implemented by Aeson+-- work only with instances of 'FromJSON' class.+-- Functions defines in this module are using 'Decoder' argument+-- instead of instance implementation. -- | Efficiently deserialize a JSON value from a lazy 'L.ByteString'. -- If this fails due to incomplete or invalid input, 'Nothing' is