@hackage dahdit0.8.0
Binary parsing and serialization with integrated size
Installation
Tested Compilers
Dependencies (13)
- base >=4.12 && <5
- bytestring >=0.11 && <0.13
- containers >=0.6 && <0.7
- data-default >=0.7 && <0.8
- data-sword >=0.2 && <0.3
- free >=5.1 && <5.3 Show all…
Dependents (4)
@hackage/dahdit-test, @hackage/dahdit-network, @hackage/dahdit-audio, @hackage/dahdit-midi
dahdit
Binary parsing and serialization with integrated size.
(dahs and dits are signal durations in Morse code)
This differs from binary in a few ways:
- It supports parsing from (or rendering into) pinned or unpinned memory.
- It uses
ByteArrayinternally to avoid generating new or retaining references to old pinned memory. - Examining
Putcan yield required byte size without serializing. - Derivation uses
viaand notanyclassfor better control of derived instances. - Types implementing
Binarycan implementbyteSizedfor size calculation (or it will reflect onput). - Known-statically-sized types can implement
StaticByteSizedfor size speedups. - Provides several additional types representing fixed-length strings or sequences (using
TypeLits).
Static sizes
You may find it necessary to discharge simple KnownNat constraints with a plugin like ghc-typelits-knownnat.
Add that package to your dependencies and add this to the top of the necessary files:
{-# OPTIONS_GHC -fplugin GHC.TypeLits.KnownNat.Solver #-}