bytestring-csv-0.1: Parse CSV formatted data efficiently

MaintainerDon Stewart <>






type CSV = [Record]Source

A CSV file is a series of records. According to the RFC, the records all have to have the same length. As an extension, I allow variable length records.

type Record = [Field]Source

A record is a series of fields Each record is located on a separate line, delimited by a line break (CRLF).

type Field = ByteStringSource

A field is a strict ByteString. Within the header and each record, there may be one or more ields, separated by commas. Each line should contain the same number of fields throughout the file. Spaces are considered part of a field and should not be ignored. The last field in the record must not be followed by a comma.

parseCSV :: ByteString -> Maybe CSVSource

Parse a ByteString into a CSV form.