Copyright | © 2015 Patryk Zadarnowski <pat@jantar.org> |
---|---|
License | BSD3 |
Maintainer | pat@jantar.org |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
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.
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
.