quiver-csv-0.0.0.2: 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.Encoder

Description

Streaming CSV file decoder compliant with RFC 4180. All fields are quoted except for short fields consisting entirely of “safe” ASCII characters, i.e., printable 7-bit characters other than quote and comma. The maximum length of an unquoted field is supplied explicitly to the encoder, which allows us to decide whether a given field requires quoting without unbounded lookahead.

Synopsis

Documentation

encodeCSV :: Int -> SP (Cell ByteString.ByteString) 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 Lazy.ByteString) 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.