Safe Haskell | None |
---|---|
Language | Haskell2010 |
Flat.Filler
Description
Pre-value and post-value byte alignments
Synopsis
- data Filler
- fillerLength :: Num a => Filler -> a
- data PreAligned a = PreAligned {}
- preAligned :: a -> PreAligned a
- data PostAligned a = PostAligned {
- postValue :: a
- postFiller :: Filler
- postAligned :: a -> PostAligned a
- preAlignedDecoder :: Get b -> Get b
- postAlignedDecoder :: Get b -> Get b
Documentation
A meaningless sequence of 0 bits terminated with a 1 bit (easier to implement than the reverse)
Used to align encoded values at byte/word boundaries.
Instances
Generic Filler Source # | |||||
Defined in Flat.Filler Associated Types
| |||||
Show Filler Source # | |||||
NFData Filler Source # | |||||
Defined in Flat.Filler | |||||
Flat Filler Source # | Use a special encoding for the filler | ||||
Eq Filler Source # | |||||
Ord Filler Source # | |||||
type Rep Filler Source # | |||||
Defined in Flat.Filler type Rep Filler = D1 ('MetaData "Filler" "Flat.Filler" "flat-0.6-GIxAJKlY2Kk3vSSSZInyiU" 'False) (C1 ('MetaCons "FillerBit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (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 | |
Instances
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
Generic (PostAligned a) Source # | |||||
Defined in Flat.Filler Associated Types
Methods from :: PostAligned a -> Rep (PostAligned a) x # to :: Rep (PostAligned a) x -> PostAligned a # | |||||
Show a => Show (PostAligned a) Source # | |||||
Defined in Flat.Filler Methods showsPrec :: Int -> PostAligned a -> ShowS # show :: PostAligned a -> String # showList :: [PostAligned a] -> ShowS # | |||||
NFData a => NFData (PostAligned a) Source # | |||||
Defined in Flat.Filler Methods rnf :: PostAligned a -> () # | |||||
Flat a => Flat (PostAligned a) Source # | |||||
Defined in Flat.Filler | |||||
Eq a => Eq (PostAligned a) Source # | |||||
Defined in Flat.Filler Methods (==) :: PostAligned a -> PostAligned a -> Bool # (/=) :: PostAligned a -> PostAligned a -> Bool # | |||||
Ord a => Ord (PostAligned a) Source # | |||||
Defined in Flat.Filler Methods compare :: PostAligned a -> PostAligned a -> Ordering # (<) :: PostAligned a -> PostAligned a -> Bool # (<=) :: PostAligned a -> PostAligned a -> Bool # (>) :: PostAligned a -> PostAligned a -> Bool # (>=) :: PostAligned a -> PostAligned a -> Bool # max :: PostAligned a -> PostAligned a -> PostAligned a # min :: PostAligned a -> PostAligned a -> PostAligned a # | |||||
type Rep (PostAligned a) Source # | |||||
Defined in Flat.Filler type Rep (PostAligned a) = D1 ('MetaData "PostAligned" "Flat.Filler" "flat-0.6-GIxAJKlY2Kk3vSSSZInyiU" '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
preAlignedDecoder :: Get b -> Get b Source #
Decode a value assuming that is PreAligned
Since: 0.5
postAlignedDecoder :: Get b -> Get b Source #
Decode a value assuming that is PostAligned