CSV parsing interprets delimited text as records and fields. A practical parser reads a file, splits records into lines and fields, checks row shape, and stores the result for searching, statistics, or rewriting. section 7.1 section 8.1
Treat a CSV file as follows:
- Represent one record per line, with fields separated consistently throughout the file. section 7.1
- Allow an optional header and configurable line and field separators; default to no header, newline records, and comma-separated fields. section 8.1
- Skip empty lines, require equal field counts, and report the line number when a row has the wrong shape. section 8.1
- Keep the learning parser deliberately simple by disregarding quoted fields and escaped double quotes. section 8.1
Parsing options in Haskell
Model separators and header handling explicitly: Separators stores line and field characters, HeaderOption distinguishes WithHeader from WithoutHeader, and CsvParseOptions combines both. Data.Text supplies split and splitOn for turning text into lines or fields.

