flat-0.4.4.0.0.0.0.2: Principled and efficient bit-oriented binary serialization.
Safe Haskell None
Language Haskell2010

Flat.Filler

Description

Pre-value and post-value byte alignments

Synopsis

Documentation

data Filler Source #

A meaningless sequence of 0 bits terminated with a 1 bit (easier to implement than the reverse) Useful to align an encoded value at byte/word boundaries.

Instances

Instances details
Eq Filler Source #
Instance details

Defined in Flat.Filler

Ord Filler Source #
Instance details

Defined in Flat.Filler

Show Filler Source #
Instance details

Defined in Flat.Filler

Generic Filler Source #
Instance details

Defined in Flat.Filler

NFData Filler Source #
Instance details

Defined in Flat.Filler

Flat Filler Source #

Use a special encoding for the filler

Instance details

Defined in Flat.Filler

type Rep Filler Source #
Instance details

Defined in Flat.Filler

fillerLength :: Num a => Filler -> a Source #

Length of a filler in bits

data PreAligned a Source #

A Pre aligned value, a value preceded by a filler Useful to prealign ByteArrays, Texts and any structure that can be encoded more efficiently when byte aligned.

Instances

Instances details
Eq a => Eq ( PreAligned a) Source #
Instance details

Defined in Flat.Filler

Ord a => Ord ( PreAligned a) Source #
Instance details

Defined in Flat.Filler

Show a => Show ( PreAligned a) Source #
Instance details

Defined in Flat.Filler

Generic ( PreAligned a) Source #
Instance details

Defined in Flat.Filler

Associated Types

type Rep ( PreAligned a) :: Type -> Type Source #

NFData a => NFData ( PreAligned a) Source #
Instance details

Defined in Flat.Filler

Flat a => Flat ( PreAligned a) Source #
Instance details

Defined in Flat.Filler

type Rep ( PreAligned a) Source #
Instance details

Defined in Flat.Filler

preAligned :: a -> PreAligned a Source #

Pre align a value

data PostAligned a Source #

A Post aligned value, a value followed by a filler Useful to complete the encoding of a top-level value

Instances

Instances details
Eq a => Eq ( PostAligned a) Source #
Instance details

Defined in Flat.Filler

Ord a => Ord ( PostAligned a) Source #
Instance details

Defined in Flat.Filler

Show a => Show ( PostAligned a) Source #
Instance details

Defined in Flat.Filler

Generic ( PostAligned a) Source #
Instance details

Defined in Flat.Filler

Associated Types

type Rep ( PostAligned a) :: Type -> Type Source #

NFData a => NFData ( PostAligned a) Source #
Instance details

Defined in Flat.Filler

Flat a => Flat ( PostAligned a) Source #
Instance details

Defined in Flat.Filler

type Rep ( PostAligned a) Source #
Instance details

Defined in Flat.Filler

type Rep ( PostAligned a) = D1 (' MetaData "PostAligned" "Flat.Filler" "flat-0.4.4.0.0.0.0.2-2QbDzx1H0Q7GNW7eleHai1" ' False ) ( C1 (' MetaCons "PostAligned" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "postValue") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 a) :*: S1 (' MetaSel (' Just "postFiller") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Filler )))

postAligned :: a -> PostAligned a Source #

Post align a value

postAlignedDecoder :: Get b -> Get b Source #

Decode a value assuming that is PostAligned