|
1 | 1 | For the latest version of this document, please see [https://github.com/haskell/aeson/blob/master/changelog.md](https://github.com/haskell/aeson/blob/master/changelog.md).
|
2 | 2 |
|
3 |
| -### 2.2 |
4 |
| - |
5 |
| -* Use `Data.Aeson.Decoding` parsing functions as default in `Data.Aeson`. |
6 |
| -* Move `Data.Aeson.Parser` module into separate `attoparsec-aeson` package, as these parsers are not used by `aeson` itself anymore. |
7 |
| -* Remove `cffi` flag. Then the C implementation for string unescaping was used for `text <2` versions. |
8 |
| - The new native Haskell implementation introduced in version 2.0.3.0 is at least as fast. |
9 |
| -* Drop instances for `attoparsec.Number`. |
| 3 | +### 2.2.0.0 |
| 4 | + |
| 5 | +* Rework how `omitNothingFields` works. Add `allowOmittedFields` as a parsing counterpart. |
| 6 | + |
| 7 | + New type-class members were added: `omitField :: a -> Bool` to `ToJSON` and `omittedField :: Maybe a` to `FromJSON`. |
| 8 | + These control which fields can be omitted. |
| 9 | + The `.:?=`, `.:!=` and `.?=` operators were added to make use of these new members. |
| 10 | + |
| 11 | + GHC.Generics and Template Haskell deriving has been updated accordingly. |
| 12 | + Note: They behave as the parsers have been written with `.:!=`, i.e. |
| 13 | + if the field value is `null` it's passed to the underlying parser. |
| 14 | + This doesn't make difference for `Maybe` or `Option`, but does make for |
| 15 | + types which parser doesn't accept `null`. |
| 16 | + (`()` parser accepts everything and `Proxy` accepts `null). |
| 17 | + |
| 18 | + In addition to `Maybe` (and `Option`) fields the `Data.Monoid.First` and `Data.Monoid.Last` are also omitted, |
| 19 | + as well as the most newtype wrappers, when their wrap omittable type (e.g. newtypes in `Data.Monoid` and `Data.Semigroup`, `Identity`, `Const`, `Tagged`, `Compose`). |
| 20 | + Additionall "boring" types like `()` and `Proxy` are omitted as well. |
| 21 | + As the omitting is now uniform, type arguments are also omitted (also in `Generic1` derived instance). |
| 22 | + |
| 23 | + Resolves issues |
| 24 | + [#687](https://github.com/haskell/aeson/issues/687), |
| 25 | + [#571](https://github.com/haskell/aeson/issues/571), |
| 26 | + [#792](https://github.com/haskell/aeson/issues/792). |
| 27 | + |
| 28 | +* Use `Data.Aeson.Decoding` parsing functions (introduced in version 2.1.2.0) as default in `Data.Aeson`. |
| 29 | +* Move `Data.Aeson.Parser` module into separate [`attoparsec-aeson`](https://hackage.haskell.org/package/attoparsec-aeson) package, as these parsers are not used by `aeson` itself anymore. |
| 30 | +* Use [`text-iso8601`](https://hackage.haskell.org/package/text-iso8601) package for parsing `time` types. These are slightly faster than previously used (copy of) `attoparsec-iso8601`. |
| 31 | +* Remove `cffi` flag. Toggling the flag made `aeson` use a C implementation for string unescaping (used for `text <2` versions). |
| 32 | + The new native Haskell implementation (introduced in version 2.0.3.0) is at least as fast. |
| 33 | +* Drop instances for `Number` from `attoparsec` package. |
10 | 34 | * Improve `Arbitrary Value` instance.
|
11 | 35 |
|
12 | 36 | ### 2.1.2.1
|
|
0 commit comments