quiver-csv-0.0.0.1: Quiver combinators for cellular CSV data processing

Copyright© 2015 Patryk Zadarnowski <pat@jantar.org>
LicenseBSD3
Maintainerpat@jantar.org
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Control.Quiver.CSV

Description

Aan efficient Quiver-based implementation of a cellular CSV encoder and decoder, designed for fast streaming of data with guaranteed constant memory usage.

Synopsis

Documentation

type ParseResult e = Maybe (Maybe e) Source

Codec result type.

pattern ParseIncomplete :: Maybe t Source

Codec result value indicating premature termination of the consumer.

pattern ParseComplete :: Maybe (Maybe t) Source

Codec result value indicating successful processing of the entire input stream.

pattern ParseFailed :: t -> Maybe (Maybe t) Source

Codec result value indicating unsuccessful processing of the input stream.

data ParseError Source

Codec error type.

Constructors

IncompleteCell

Input ends in a partial cell value. For encoder, this means that the last Cell of the input stream specifies the EOP delimiter instead of EOR or EOT. For decoder, this means that the last cell of the input stream is missing the closing quote character.

IncompleteRow

Input ends in a partial row value. For encoder, this means that the last Cell of the input stream specifies the EOC delimiter instead of EOR or EOT. For decoder, this means that the last row of the input stream is missing the line break sequence.

decodeCSV :: Functor f => SP ByteString (Cell ByteString) f (ParseResult ParseError) Source

A Quiver processor that parses a fragmented strict representation of a CSV file into a stream of cells.

decodeLazyCSV :: Functor f => SP ByteString (Cell ByteString) f (ParseResult ParseError) Source

A Quiver processor that parses a fragmented lazy representation of a CSV file into a stream of cells.

encodeCSV :: Int -> SP (Cell ByteString) ByteString f (ParseResult ParseError) Source

encodeCSV n is an infinite pipe that converts a stream of cells into a fragmented strict representation of a CSV file, unconditionally quoting any field values with length greater than n.

encodeLazyCSV :: Int -> SP (Cell ByteString) ByteString f (ParseResult ParseError) Source

encodeLazyCSV n is an infinite pipe that converts a stream of cells into a fragmented lazy representation of a CSV file, unconditionally quoting any field values with length greater than n.