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

Safe HaskellNone
LanguageHaskell2010

Flat.Encoder

Description

Encoder and encoding primitives

Synopsis

Documentation

data Encoding Source #

Instances
Show Encoding Source # 
Instance details

Defined in Flat.Encoder.Strict

Semigroup Encoding Source # 
Instance details

Defined in Flat.Encoder.Strict

Monoid Encoding Source # 
Instance details

Defined in Flat.Encoder.Strict

(<>) :: 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