data Person = Person { first :: ByteString, last :: ByteString }
instance FromNamedRecord Person where
parseNamedRecord r =
Person <$> r .:: ["firstName", "fname"] <*> lookupChoice r ["lastName", "lname"]
which is useful when working with a small set of similarly-structured CSV files,
or where field names vary slightly.
This helper function allows code like:
which is useful when working with a small set of similarly-structured CSV files, or where field names vary slightly.