binary-tagged: Tagged binary serialisation.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

Check README on Github


[Skip to ReadMe]

Properties

Versions0.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.1.5.2, 0.2
Change logCHANGELOG.md
Dependenciesaeson (>=0.8 && <1.5), array (>=0.5.0.0 && <0.6), base (>=4.7.0.2 && <4.13), base16-bytestring (>=0.1.1.6 && <0.2), binary (>=0.7.1.0 && <0.10), bytestring (>=0.10.4.0 && <0.11), containers (>=0.5.5.1 && <0.7), generics-sop (>=0.3.2.0 && <0.6), hashable (>=1.2 && <1.4), nats (>=1.1.2 && <1.2), scientific (==0.3.*), semigroups (>=0.18.5 && <0.20), SHA (==1.6.*), tagged (>=0.7 && <0.9), text (>=1.2.3.0 && <1.3), time (>=1.4.2 && <1.9), unordered-containers (==0.2.*), vector (>=0.10 && <0.13) [details]
LicenseBSD-3-Clause
AuthorOleg Grenrus <oleg.grenrus@iki.fi>
MaintainerOleg Grenrus <oleg.grenrus@iki.fi>
CategoryData
Home pagehttps://github.com/phadej/binary-tagged#readme
Bug trackerhttps://github.com/phadej/binary-tagged/issues
Source repositoryhead: git clone https://github.com/phadej/binary-tagged
UploadedFri May 10 17:33:56 UTC 2019 by phadej

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for binary-tagged-0.1.5.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.