Convert lists of strings to records.
- type Column = String
- type Row = Map Column String
- type Table = [Row]
- fromStrings :: [[String]] -> Result Table
- data Result a
- data RowError
- class Field a where
- require :: (String -> Maybe a) -> Maybe String -> Result a
- safeRead :: Read a => String -> Maybe a
- getField :: Field a => Column -> Row -> Result a
- class ParseRow a where
- parseTable :: ParseRow a => Table -> Result [a]
A parse result.
Possible errors from parsing a row.
Class of field types which can be decoded from
The input can be
to represent a missing field.
Field a => Field (Maybe a) models optional fields.
If your record contains custom types, you must create a
instance for each. If you have base types but need different
parsing behavior, you can use a
for a required field.
Decode a field by column name.
Called from TH-generated code, but may be useful independently.
Class of types which can be parsed from a
These types are typically single-constructor records.
Instances may be generated using