| Copyright | © 2015 Patryk Zadarnowski <pat@jantar.org> |
|---|---|
| License | BSD3 |
| Maintainer | pat@jantar.org |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | Safe |
| Language | Haskell2010 |
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.
- type ParseResult e = Maybe (Maybe e)
- pattern ParseIncomplete :: Maybe t
- pattern ParseComplete :: Maybe (Maybe t)
- pattern ParseFailed :: t -> Maybe (Maybe t)
- data ParseError
- decodeCSV :: Functor f => SP ByteString (Cell ByteString) f (ParseResult ParseError)
- decodeLazyCSV :: Functor f => SP ByteString (Cell ByteString) f (ParseResult ParseError)
- encodeCSV :: Int -> SP (Cell ByteString) ByteString f (ParseResult ParseError)
- encodeLazyCSV :: Int -> SP (Cell ByteString) ByteString f (ParseResult ParseError)
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 |
| IncompleteRow | Input ends in a partial row value.
For encoder, this means that the last |
Instances
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.