colonnade-0.3: Generic types and functions for columnar encoding and decoding

Safe HaskellNone
LanguageHaskell2010

Colonnade.Types

Synopsis

Documentation

newtype Encoding f content a Source

Constructors

Encoding 

Fields

getEncoding :: Vector (OneEncoding f content a)
 

Instances

Divisible (Encoding f content) Source 
Contravariant (Encoding f content) Source 
Monoid (Encoding f content a) Source 

data Decoding f content a where Source

This just actually a specialization of the free applicative. Check out Control.Applicative.Free in the free library to learn more about this. The meanings of the fields are documented slightly more in the source code. Unfortunately, haddock does not play nicely with GADTs.

Constructors

DecodingPure :: !a -> Decoding f content a 
DecodingAp :: !(f content) -> !(content -> Either String a) -> !(Decoding f content (a -> b)) -> Decoding f content b 

Instances

Functor (Decoding f content) Source 
Applicative (Decoding f content) Source 

data OneEncoding f content a Source

Encodes a header and a cell.

Constructors

OneEncoding 

Fields

oneEncodingHead :: !(f content)
 
oneEncodingEncode :: !(a -> content)
 

Instances

newtype Headed a Source

Isomorphic to Identity

Constructors

Headed 

Fields

getHeaded :: a
 

data Indexed f a Source

Constructors

Indexed 

Fields

indexedIndex :: !Int
 
indexedHeading :: !(f a)
 

Instances

Functor f => Functor (Indexed f) Source 
Eq (f a) => Eq (Indexed f a) Source 
Ord (f a) => Ord (Indexed f a) Source 
Read (f a) => Read (Indexed f a) Source 
Show (f a) => Show (Indexed f a) Source 

data HeadingErrors content Source

Constructors

HeadingErrors 

Fields

headingErrorsMissing :: Vector content

headers that were missing

headingErrorsDuplicate :: Vector (content, Int)

headers that occurred more than once

Instances

Eq content => Eq (HeadingErrors content) Source 
Read content => Read (HeadingErrors content) Source 
Show content => Show (HeadingErrors content) Source 
(Show content, Typeable * content) => Exception (HeadingErrors content) Source 
Monoid (HeadingErrors content) Source 

data DecodingCellError f content Source

Instances

(Eq content, Eq (f content)) => Eq (DecodingCellError f content) Source 
(Read content, Read (f content)) => Read (DecodingCellError f content) Source 
(Show content, Show (f content)) => Show (DecodingCellError f content) Source 

data DecodingRowError f content Source

Constructors

DecodingRowError 

Instances

(Eq content, Eq (f content)) => Eq (DecodingRowError f content) Source 
(Read content, Read (f content)) => Read (DecodingRowError f content) Source 
(Show content, Show (f content)) => Show (DecodingRowError f content) Source 

newtype DecodingCellErrors f content Source

Instances

(Eq content, Eq (f content)) => Eq (DecodingCellErrors f content) Source 
(Read content, Read (f content)) => Read (DecodingCellErrors f content) Source 
(Show content, Show (f content)) => Show (DecodingCellErrors f content) Source 
Monoid (DecodingCellErrors f content) Source 

data RowError f content Source

Constructors

RowErrorParse !String

Error occurred parsing the document into cells

RowErrorDecode !(DecodingCellErrors f content)

Error decoding the content

RowErrorSize !Int !Int

Wrong number of cells in the row

RowErrorHeading !(HeadingErrors content) 
RowErrorMinSize !Int !Int 
RowErrorMalformed !String

Error decoding unicode content

Instances

(Eq content, Eq (f content)) => Eq (RowError f content) Source 
(Read content, Read (f content)) => Read (RowError f content) Source 
(Show content, Show (f content)) => Show (RowError f content) Source