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

Copyright© 2015 Patryk Zadarnowski <pat@jantar.org>
LicenseBSD3
Maintainerpat@jantar.org
Stabilityexperimental
Portabilityportable
Safe HaskellNone
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

data CSVError 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 CSVError 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 CSVError 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 CSVError 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 CSVError 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.