@@ -1,27 +1,50 @@
1# 0.3 to 0.4
1# 0.3 to 0.4
6+function](http://hackage.haskell.org/packages/archive/aeson/latest/doc/html/Data-Aeson.html#v:decode)
7+complements the longstanding `encode` function, and makes the API
10+[New examples](https://github.com/bos/aeson/tree/master/examples) make
11+it easier to learn to use the package.
3## Generics support
14## Generics support
5−Aeson's support for data-type generic programming makes it possible to
16+aeson's support for data-type generic programming makes it possible to
6use JSON encodings of most data types without writing any boilerplate
17use JSON encodings of most data types without writing any boilerplate
9Thanks to Bas Van Dijk, aeson now supports the two major schemes for
20Thanks to Bas Van Dijk, aeson now supports the two major schemes for
10doing datatype-generic programming:
21doing datatype-generic programming:
12−* the newer mechanism, [built into GHC
23+* the modern mechanism, [built into GHC
13 itself](http://www.haskell.org/ghc/docs/latest/html/users_guide/generic-programming.html)
24 itself](http://www.haskell.org/ghc/docs/latest/html/users_guide/generic-programming.html)
15−* the older mechanism, based on SYB (for "scrap your boilerplate")
26+* the older mechanism, based on SYB (aka "scrap your boilerplate")
17−The GHC-based generics are fast and terse: in fact, they're generally
28+The modern GHC-based generic mechanism is fast and terse: in fact, its
18−comparable in performance to hand-written `ToJSON` and `FromJSON`
29+performance is generally comparable in performance to hand-written and
19−instances. To see how to use GHC generics, see
30+TH-derived `ToJSON` and `FromJSON` instances. To see how to use GHC
20[`examples/Generic.hs`](https://github.com/bos/aeson/blob/master/examples/Generic.hs).
32[`examples/Generic.hs`](https://github.com/bos/aeson/blob/master/examples/Generic.hs).
22The SYB-based generics support lives in
34The SYB-based generics support lives in
23−[Data.Aeson.Generic](http://hackage.haskell.org/packages/archive/aeson/0.4.0.0/doc/html/Data-Aeson-Generic.html),
35+[Data.Aeson.Generic](http://hackage.haskell.org/packages/archive/aeson/latest/doc/html/Data-Aeson-Generic.html),
24−and is provided mainly for users of GHC older than 7.2. It's far
36+and is provided mainly for users of GHC older than 7.2. SYB is far
25slower (by about 10x) than the more modern generic mechanism. To see
37slower (by about 10x) than the more modern generic mechanism. To see
26−how to use SYB generics, see
38+how to use SYB generics, refer to
27[`examples/GenericSYB.hs`](https://github.com/bos/aeson/blob/master/examples/GenericSYB.hs).
39[`examples/GenericSYB.hs`](https://github.com/bos/aeson/blob/master/examples/GenericSYB.hs).
42+## Improved performance
44+* We switched the intermediate representation of JSON objects from
46+ [`Data.HashMap`](http://hackage.haskell.org/package/unordered-containers),
47+ which has improved type conversion performance.
49+* Instances of `ToJSON` and `FromJSON` for tuples are between 45% and
50+ 70% faster than in 0.3.