Binary serialization tagged with type information, allowing for
typechecking and useful error messages at the receiving site.
This package serves the same purpose as tagged-binary, with a couple of key differences:
Support of different kinds of serialized type annotations, each with specific strengths and weaknesses.
Error messages can provide details on type errors at the cost of longer message lengths to include the necessary information.
Very small performance overhead compared to using standard
Binarydue to caching when using hashed type information. Since shown and full types are not cached, decoding them has a significant performance hit (ballpark: factor of two).
No depencency on
Internalmodules of other libraries, and a very small dependency footprint in general.
For information about usage, see the
Performance-wise, here is a value
Right (Left <100 chars lipsum>) of
Either (Char, Int) (Either String (Maybe Integer)) benchmarked
Hashed64 type representation:
- Add testsuite to compare generated message lengths with vanilla
Binaryand the various different typed serializations.
- The .cabal file is hopefully fixed so that Hackage is able to build the docs automatically.
Hashed32type representation with 32 bit, more suitable for short data than the previous
Hashed, which was implicitly 64 bit long.
Hashed64is also available in case the longer hash is needed.
- Type representations are now automatically cached by
encodeTyped. If this data is long enough, it is even serialized in advance as well.
- Fix whitespace in docs to make the docs build properly on Hackage, which presumably has an older Haddock version
- Fix sharing not working at all (bad
- Pre-calculate certain functions in the benchmarks so they can be properly shared among invocations
Hashed5type representation that has no size overhead compared to
- Add script to upload documentation to Hackage, since with the use of the new
TypeableGHC 7.6.3, which Hackage currently runs, cannot build the docs itself.
- Decoding now caches as well for
Hashed*representations. This saves recalculating the
TypeRepof the expected type, which previously was the bottleneck. Both encoding and decoding speeds are now very close to untyped
Debugmodule, which is a drop-in replacement for the ordinary API. However, a message is emitted via
Debug.Traceevery time a type representation is calculated, which makes it possible to debug proper sharing/caching.