on master help sign in
Export `decodeWith', `decodeStrictWith', `eitherDecodeWith', and `eitherDecodeStrictWith' from `Data.Aeson.Parser'.
319ef69Adam Bergmark
Data/Aeson/Parser.hs+8−1
@@ -39,9 +39,16 @@ module Data.Aeson.Parser
39 -- $strict
39 -- $strict
40 , json'
40 , json'
41 , value'
41 , value'
42+ -- * Decoding without FromJSON instances
43+ , decodeWith
44+ , decodeStrictWith
45+ , eitherDecodeWith
46+ , eitherDecodeStrictWith
42 ) where
47 ) where
43
48
49+import Data.Aeson.Parser.Internal (decodeStrictWith, decodeWith,
50+ eitherDecodeStrictWith, eitherDecodeWith,
44−import Data.Aeson.Parser.Internal (json, json', jstring, value, value')
51+ json, json', jstring, value, value')
45
52
46-- $lazy
53-- $lazy
47--
54--
changelog.md+6−1
@@ -6,11 +6,16 @@ For the latest version of this document, please see [https://github.com/bos/aeso
6 way `Read` / `Show` handle lists specifically. This removes need for
6 way `Read` / `Show` handle lists specifically. This removes need for
7 overlapping instances to handle `String`.
7 overlapping instances to handle `String`.
8
8
9−* Added higher rank classes: `ToJSON1`, `ToJSON2`, `FromJSON1`, and `FromJSON2`
9+* Added higher rank classes: `ToJSON1`, `ToJSON2`, `FromJSON1`, and `FromJSON2`.
10
10
11* Modified instances for `Map` and `HashMap`. Introduced new `FromJSONKey` and
11* Modified instances for `Map` and `HashMap`. Introduced new `FromJSONKey` and
12 `ToJSONKey` type classes.
12 `ToJSONKey` type classes.
13
13
14+* Export `decodeWith`, `decodeStrictWith`, `eitherDecodeWith`, and
15+ `eitherDecodeStrictWith` from `Data.Aeson.Parser`. This allows
16+ decoding using explicit parsers instead of using `FromJSON`
17+ instances.
18+
14* Remove the `contents` field encoding with `allNullaryToStringTag = False`,
19* Remove the `contents` field encoding with `allNullaryToStringTag = False`,
15 giving us `{ "tag" : "c1" }` instead of `{ "tag" : "c1", contents : [] }`.
20 giving us `{ "tag" : "c1" }` instead of `{ "tag" : "c1", contents : [] }`.
16 The contents field is optional when parsing so this is only a breaking change for ToJSON.
21 The contents field is optional when parsing so this is only a breaking change for ToJSON.