faylang/fay — pull request #403 by chrisdone (2014-04-25 21:22:38+00:00)
Title: Syb show to fay

This introduces the following breaking changes to `Fay.Convert`:

* `readFromFay` now has a `Data` constraint instead of `Show`
* Aeson support has been changed to instead of use explicit parsers for ints/integers/etc, just use Aeson's own parsers. This avoids needing separate CPP `#ifdef`s for <0.7 and >=0.7.
* Drops support for `Rational` and `Integer` (see below for migration steps). The reason is that neither was serialized in a way that would roundtrip for all values. Also, for similar reasons, `fromRational` is potentially divergent for aeson's new use of the `Scientific` type.

And adds the following features:

* Better performance due to not using syb instead of parsing the results of `show`.
* Allows the serialization and deserialization to be customized on a per-type basis, via `encodeFay` and `decodeFay`.

To migrate code using Rational or Integer, use `encodeFay` and pass an argument e.g. something like

``` haskell
(\f x -> maybe (f x) myIntegerToValueConversion (cast x))
```

and likewise to `decodeFay`.