Copyright | © 2015 Patryk Zadarnowski <pat@jantar.org> |
---|---|

License | BSD3 |

Maintainer | pat@jantar.org |

Stability | experimental |

Portability | portable |

Safe Haskell | Safe |

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.

- encodeCSV :: Monad m => Int -> Pipe (Cell ByteString.ByteString) ByteString.ByteString m ()
- encodeLazyCSV :: Monad m => Int -> Pipe (Cell Lazy.ByteString) ByteString.ByteString m ()

# Documentation

encodeCSV :: Monad m => Int -> Pipe (Cell ByteString.ByteString) ByteString.ByteString m () Source

`encodeCSV n`

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

.

encodeLazyCSV :: Monad m => Int -> Pipe (Cell Lazy.ByteString) ByteString.ByteString m () Source

`encodeLazyCSV n`

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

.