Parsing CSV in Haskell

Posted on September 30, 2019 by Riccardo

Parsing CSV without header:

Parsing CSV to a data type requires having an instance of FromRecord for that type:

Or the same thing using generics:

Parsing CSV with explicit reference to the fields. This way the code is more robust to changes in the CSV (e.g. change order of columns):

Or the same thing using generics: