skiping line using empty or mzero
It would be nice to be able to skip record (when parsing) like blank line, comment etc ... I tried using mzero for that, but it's equivalent to fail which indeed mean the record is invalid. Would it be possible to change the meaning of empty or mzero to just skip the line being parsed instead of generating a failure ?
I think #146 is related/can be used for this.
I think my use case is slightly different but I might be wrong.
My use case is either to be able to skip comments for example. I know comments are probably but not part of the CSV format, but it is sometimes handy to be able to filter lines starting with # or -- etc ... My other use case would be to be able to try different ways of parsing a row (for example column name, address => Person or product, price => Product). However, as cassava uses attoparsec it might be possible through the Alternative instance.
I don't think you want the meaning of mzero to change as it breaks the Alternative laws.
However, if you use the Try with a FromRecord instance (as there's no Either-based instance for that class; alternatively write such an instance), then you can examine each resulting failure case and see if you want to skip it, re-parse it differently, etc.
Though for the Person | Product case, using <|> is probably the better option; it does mean you can only have a FromRecord instance and not FromNamedRecord (I'm also curious as to how such a CSV file makes sense, but I suppose people do weird things with their spreadsheets ;-)