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

Flat.Encoder

Description

Encoder and encoding primitives

Synopsis

Documentation

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

An associative operation.

>>> [1,2,3] <> [4,5,6]
[1,2,3,4,5,6]

type NumBits = Int Source #

Number of bits

mempty :: Monoid a => a Source #

Identity of mappend

>>> "Hello world" <> mempty
"Hello world"

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