The binary-tagged package

[Tags:benchmark, bsd3, library, test]

Check README on Github


[Skip to Readme]

Properties

Versions 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
Change log CHANGELOG.md
Dependencies aeson (>=0.8 && <1.3), array (==0.5.*), base (>=4.7 && <4.11), base16-bytestring (>=0.1.1.6 && <0.2), binary (>=0.7 && <0.10), bytestring (==0.10.*), containers (==0.5.*), generics-sop (>=0.1 && <0.4), hashable (==1.2.*), nats (>=1 && <1.2), scientific (==0.3.*), semigroups (>=0.16 && <0.19), SHA (==1.6.*), tagged (>=0.7 && <0.9), text (==1.2.*), time (>=1.4 && <1.9), unordered-containers (==0.2.*), vector (>=0.10 && <0.13) [details]
License BSD3
Author Oleg Grenrus <oleg.grenrus@iki.fi>
Maintainer Oleg Grenrus <oleg.grenrus@iki.fi>
Category Web
Home page https://github.com/phadej/binary-tagged#readme
Bug tracker https://github.com/phadej/binary-tagged/issues
Source repository head: git clone https://github.com/phadej/binary-tagged
Uploaded Mon Dec 5 12:17:32 UTC 2016 by phadej
Updated Tue Jun 27 13:15:39 UTC 2017 by phadej to revision 7
Distributions Arch:0.1.4.2, Debian:0.1.3.0, LTSHaskell:0.1.4.2, NixOS:0.1.4.2, Stackage:0.1.4.2, Tumbleweed:0.1.4.2
Downloads 2025 total (394 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2016-12-08 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for binary-tagged

Readme for binary-tagged-0.1.4.2

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.