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

Safe HaskellNone
LanguageHaskell2010

Data.Flat.Instances

Contents

Description

Flat Instances for common, primitive and abstract data types for which instances cannot be automatically derived

Synopsis

Documentation

sizeMap :: (Flat (ContainerKey r), Flat (MapValue r), IsMap r) => Size r Source #

Calculate size of an instance of IsMap

encodeMap :: (Flat (ContainerKey map), Flat (MapValue map), IsMap map) => map -> Encoding Source #

Encode an instance of IsMap, as a list

decodeMap :: (Flat (ContainerKey map), Flat (MapValue map), IsMap map) => Get map Source #

Decode an instance of IsMap, as a list

sizeSequence :: (IsSequence mono, Flat (Element mono)) => mono -> NumBits -> NumBits Source #

Calculate size of an instance of IsSequence

encodeSequence :: (Flat (Element mono), IsSequence mono) => mono -> Encoding Source #

Encode an instance of IsSequence, as an array

decodeSequence :: (Flat (Element b), IsSequence b) => Get b Source #

Decode an instance of IsSequence, as an array

Orphan instances

Flat Bool Source # 
Flat Char Source # 
Flat Double Source # 
Flat Float Source # 
Flat Int Source # 
Flat Int8 Source # 
Flat Int16 Source # 
Flat Int32 Source # 
Flat Int64 Source # 
Flat Integer Source # 
Flat Natural Source # 
Flat Word Source # 
Flat Word8 Source # 
Flat Word16 Source # 
Flat Word32 Source # 
Flat Word64 Source # 
Flat () Source # 

Methods

encode :: () -> Encoding Source #

decode :: Get () Source #

size :: () -> NumBits -> NumBits Source #

Flat ShortByteString Source # 
Flat ByteString Source # 
Flat ByteString Source # 
Flat Text Source # 
Flat UTF16Text Source # 
Flat UTF8Text Source # 
Flat [Char] Source # 
Flat a => Flat [a] Source # 

Methods

encode :: [a] -> Encoding Source #

decode :: Get [a] Source #

size :: [a] -> NumBits -> NumBits Source #

Flat a => Flat (Maybe a) Source # 
Flat a => Flat (Seq a) Source # 
(Flat a, Flat b) => Flat (Either a b) Source # 
(Flat a, Flat b) => Flat (a, b) Source # 

Methods

encode :: (a, b) -> Encoding Source #

decode :: Get (a, b) Source #

size :: (a, b) -> NumBits -> NumBits Source #

(Flat a, Flat b, Ord a) => Flat (Map a b) Source # 

Methods

encode :: Map a b -> Encoding Source #

decode :: Get (Map a b) Source #

size :: Map a b -> NumBits -> NumBits Source #

(Flat a, Flat b, Flat c) => Flat (a, b, c) Source # 

Methods

encode :: (a, b, c) -> Encoding Source #

decode :: Get (a, b, c) Source #

size :: (a, b, c) -> NumBits -> NumBits Source #

(Flat a, Flat b, Flat c, Flat d) => Flat (a, b, c, d) Source # 

Methods

encode :: (a, b, c, d) -> Encoding Source #

decode :: Get (a, b, c, d) Source #

size :: (a, b, c, d) -> NumBits -> NumBits Source #

(Flat a, Flat b, Flat c, Flat d, Flat e) => Flat (a, b, c, d, e) Source # 

Methods

encode :: (a, b, c, d, e) -> Encoding Source #

decode :: Get (a, b, c, d, e) Source #

size :: (a, b, c, d, e) -> NumBits -> NumBits Source #

(Flat a, Flat b, Flat c, Flat d, Flat e, Flat f) => Flat (a, b, c, d, e, f) Source # 

Methods

encode :: (a, b, c, d, e, f) -> Encoding Source #

decode :: Get (a, b, c, d, e, f) Source #

size :: (a, b, c, d, e, f) -> NumBits -> NumBits Source #

(Flat a, Flat b, Flat c, Flat d, Flat e, Flat f, Flat g) => Flat (a, b, c, d, e, f, g) Source # 

Methods

encode :: (a, b, c, d, e, f, g) -> Encoding Source #

decode :: Get (a, b, c, d, e, f, g) Source #

size :: (a, b, c, d, e, f, g) -> NumBits -> NumBits Source #