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

Safe HaskellNone
LanguageHaskell2010

Data.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 # 

Methods

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

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

Ord Filler Source # 
Show Filler Source # 
Generic Filler Source # 

Associated Types

type Rep Filler :: * -> * #

Methods

from :: Filler -> Rep Filler x #

to :: Rep Filler x -> Filler #

NFData Filler Source # 

Methods

rnf :: Filler -> () #

Flat Filler Source #

Use a special encoding for the filler

type Rep Filler Source # 
type Rep Filler = D1 (MetaData "Filler" "Data.Flat.Filler" "flat-0.3-2nTNbEF5Ki3F05Vx99gMLg" False) ((:+:) (C1 (MetaCons "FillerBit" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Filler))) (C1 (MetaCons "FillerEnd" PrefixI False) U1))

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

Constructors

PreAligned 

Fields

Instances

Eq a => Eq (PreAligned a) Source # 

Methods

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

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

Ord a => Ord (PreAligned a) Source # 
Show a => Show (PreAligned a) Source # 
Generic (PreAligned a) Source # 

Associated Types

type Rep (PreAligned a) :: * -> * #

Methods

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

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

NFData a => NFData (PreAligned a) Source # 

Methods

rnf :: PreAligned a -> () #

Flat a => Flat (PreAligned a) Source # 
type Rep (PreAligned a) Source # 
type Rep (PreAligned a) = D1 (MetaData "PreAligned" "Data.Flat.Filler" "flat-0.3-2nTNbEF5Ki3F05Vx99gMLg" False) (C1 (MetaCons "PreAligned" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "preFiller") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Filler)) (S1 (MetaSel (Just Symbol "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

Constructors

PostAligned 

Fields

Instances

Eq a => Eq (PostAligned a) Source # 
Ord a => Ord (PostAligned a) Source # 
Show a => Show (PostAligned a) Source # 
Generic (PostAligned a) Source # 

Associated Types

type Rep (PostAligned a) :: * -> * #

Methods

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

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

NFData a => NFData (PostAligned a) Source # 

Methods

rnf :: PostAligned a -> () #

Flat a => Flat (PostAligned a) Source # 
type Rep (PostAligned a) Source # 
type Rep (PostAligned a) = D1 (MetaData "PostAligned" "Data.Flat.Filler" "flat-0.3-2nTNbEF5Ki3F05Vx99gMLg" False) (C1 (MetaCons "PostAligned" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "postValue") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)) (S1 (MetaSel (Just Symbol "postFiller") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Filler))))

postAligned :: a -> PostAligned a Source #

Post align a value