on master help sign in
Export `decodeWith', `decodeStrictWith', `eitherDecodeWith', and `eitherDecodeStrictWith' from `Data.Aeson.Parser'.

This allows decoding using explicit parsers instead of using FromJSON instances. Fixes #397.

commit319ef69719f68a19be6cc477deed485e38cc2dbd authorAdam Bergmark <adam@bergmark.nl> dateSun 5 Jun 2016, 14:00 (10 years ago) parent483510d
2 files changed+14−2
Data/Aeson/Parser.hs+8−1 changelog.md+6−1
Data/Aeson/Parser.hs+8−1
@@ -39,9 +39,16 @@ module Data.Aeson.Parser
3939 -- $strict
4040 , json'
4141 , value'
42+ -- * Decoding without FromJSON instances
43+ , decodeWith
44+ , decodeStrictWith
45+ , eitherDecodeWith
46+ , eitherDecodeStrictWith
4247 ) where
4348
44−import Data.Aeson.Parser.Internal (json, json', jstring, value, value')
49+import Data.Aeson.Parser.Internal (decodeStrictWith, decodeWith,
50+ eitherDecodeStrictWith, eitherDecodeWith,
51+ json, json', jstring, value, value')
4552
4653-- $lazy
4754--
changelog.md+6−1
@@ -6,11 +6,16 @@ For the latest version of this document, please see [https://github.com/bos/aeso
66 way `Read` / `Show` handle lists specifically. This removes need for
77 overlapping instances to handle `String`.
88
9−* Added higher rank classes: `ToJSON1`, `ToJSON2`, `FromJSON1`, and `FromJSON2`
9+* Added higher rank classes: `ToJSON1`, `ToJSON2`, `FromJSON1`, and `FromJSON2`.
1010
1111* Modified instances for `Map` and `HashMap`. Introduced new `FromJSONKey` and
1212 `ToJSONKey` type classes.
1313
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+
1419* Remove the `contents` field encoding with `allNullaryToStringTag = False`,
1520 giving us `{ "tag" : "c1" }` instead of `{ "tag" : "c1", contents : [] }`.
1621 The contents field is optional when parsing so this is only a breaking change for ToJSON.