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

Safe HaskellNone
LanguageHaskell2010

Data.Flat.Encoder

Synopsis

Documentation

(<>) :: Semigroup a => a -> a -> a infixr 6 #

An associative operation.

type NumBits = Int Source #

Number of bits

mempty :: Monoid a => a #

Identity of mappend

encodeArrayWith :: (t -> Encoding) -> [t] -> Encoding Source #

Encode as Array

encodeListWith :: (t -> Encoding) -> [t] -> Encoding Source #

Encode as a List

type Size a = a -> NumBits -> NumBits Source #

Calculate the size (in bits) of the encoding of a value