binary-tagged: Tagged binary serialisation.

[ bsd3, data, library ] [ Propose Tags ]

Modules

[Index]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.1.0, 0.1.2.0, 0.1.3.0, 0.1.3.1, 0.1.4.0, 0.1.4.1, 0.1.4.2, 0.1.5, 0.1.5.1, 0.1.5.2, 0.2, 0.3, 0.3.1
Change log CHANGELOG.md
Dependencies aeson (>=0.8 && <1.4), array (>=0.5 && <0.6), base (>=4.7 && <4.11), base16-bytestring (>=0.1.1.6 && <0.2), binary (>=0.7 && <0.10), bytestring (>=0.10 && <0.11), containers (>=0.5 && <0.6), generics-sop (>=0.1 && <0.4), hashable (>=1.2 && <1.3), nats (>=1 && <1.2), scientific (>=0.3 && <0.4), semigroups (>=0.16 && <0.19), SHA (>=1.6 && <1.7), tagged (>=0.7 && <0.9), text (>=1.2 && <1.3), time (>=1.4 && <1.9), unordered-containers (>=0.2 && <0.3), vector (>=0.10 && <0.13) [details]
License BSD-3-Clause
Author Oleg Grenrus <oleg.grenrus@iki.fi>
Maintainer Oleg Grenrus <oleg.grenrus@iki.fi>
Revised Revision 9 made by phadej at 2018-10-02T10:49:07Z
Category Web
Home page https://github.com/phadej/binary-tagged#readme
Bug tracker https://github.com/phadej/binary-tagged/issues
Source repo head: git clone https://github.com/phadej/binary-tagged
Uploaded by phadej at 2016-12-05T12:17:32Z
Distributions Arch:0.3.1, Debian:0.2, LTSHaskell:0.3.1, NixOS:0.3.1, Stackage:0.3.1
Reverse Dependencies 3 direct, 5 indirect [details]
Downloads 14978 total (40 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-12-08 [all 1 reports]

Readme for binary-tagged-0.1.4.2

[back to package description]

binary-tagged

Build Status Hackage Stackage LTS 2 Stackage LTS 3 Stackage Nightly

Structurally tag binary serialisation stream.

Say you have:

data Record = Record
  { _recordFields :: HM.HashMap Text (Integer, ByteString)
  , _recordEnabled :: Bool
  }
  deriving (Eq, Show, Generic)

instance Binary Record
instance HasStructuralInfo Record
instance HasSemanticVersion Record

then you can serialise and deserialise Record values with a structure tag by simply

encodeTaggedFile "cachefile" record
decodeTaggedFile "cachefile" :: IO Record

If structure of Record changes in between, deserialisation will fail early.

The overhead is next to non-observable, see a simple benchmark and the results.