| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Drasil.Data.Formats.CSV.Core
Contents
CSVs
A CSV file representation containing an optional header and a list of rows.
Caches the column and row counts for future potential reference.
type ColumnCount = Natural Source #
The number of columns a CSV has.
columnCount :: CSV -> ColumnCount Source #
Get the number of columns in a CSV.
Constructors
mkCSV :: Maybe ColumnCount -> Maybe [Text] -> [[Text]] -> Either String CSV Source #
Create a CSV. Expects all rows and the header to have the same length. If
the expected column count is not provided (the first parameter), then the
number of columns in the header is used as the expected column count. If the
header does not exist, the length of the first row is used. If the data is
also empty, you will have an empty CSV with no columns and no rows.