flat-0.4.4: Principled and efficient bit-oriented binary serialization.

Safe HaskellNone
LanguageHaskell2010

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.

Constructors

FillerBit Filler 
FillerEnd 
Instances
Eq Filler Source # 
Instance details

Defined in Flat.Filler

Methods

(==) :: Filler -> Filler -> Bool #

(/=) :: Filler -> Filler -> Bool #

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

Associated Types

type Rep Filler :: Type -> Type #

Methods

from :: Filler -> Rep Filler x #

to :: Rep Filler x -> Filler #

NFData Filler Source # 
Instance details

Defined in Flat.Filler

Methods

rnf :: 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

type Rep Filler = D1 (MetaData "Filler" "Flat.Filler" "flat-0.4.4-FeVyhxo3HGG15yLcuMeV64" False) (C1 (MetaCons "FillerBit" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Filler)) :+: C1 (MetaCons "FillerEnd" PrefixI False) (U1 :: Type -> Type))

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.

Constructors

PreAligned 

Fields

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

Defined in Flat.Filler

Methods

(==) :: PreAligned a -> PreAligned a -> Bool #

(/=) :: PreAligned a -> PreAligned a -> Bool #

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 #

Methods

from :: PreAligned a -> Rep (PreAligned a) x #

to :: Rep (PreAligned a) x -> PreAligned a #

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

Defined in Flat.Filler

Methods

rnf :: PreAligned a -> () #

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

Defined in Flat.Filler

type Rep (PreAligned a) Source # 
Instance details

Defined in Flat.Filler

type Rep (PreAligned a) = D1 (MetaData "PreAligned" "Flat.Filler" "flat-0.4.4-FeVyhxo3HGG15yLcuMeV64" False) (C1 (MetaCons "PreAligned" PrefixI True) (S1 (MetaSel (Just "preFiller") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Filler) :*: S1 (MetaSel (Just "preValue") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))

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

Constructors

PostAligned 

Fields

Instances
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 #

Methods

from :: PostAligned a -> Rep (PostAligned a) x #

to :: Rep (PostAligned a) x -> PostAligned a #

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

Defined in Flat.Filler

Methods

rnf :: PostAligned a -> () #

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-FeVyhxo3HGG15yLcuMeV64" 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