SagaCsv
Types
Config
record Config {
separator: String,
skip_header: Bool,
headers: List String
}Functions
reader
fun reader : Unit -> Configwriter
fun writer : Unit -> Configwith_separator
fun with_separator : String -> Config -> Configskip_header
fun skip_header : Config -> Configwith_headers
fun with_headers : List String -> Config -> Configparse
fun parse : String -> Config -> List (List String)Parse CSV data into a list of rows, where each row is a list of strings.
parse_keyed
fun parse_keyed : String -> Config -> List (Dict String String)Parse CSV data into a list of dicts, using the first row as header keys. Panics if the input has no rows.
write
fun write : List (List String) -> Config -> StringWrite rows to CSV string.
write_keyed
fun write_keyed : List (Dict String String) -> Config -> StringWrite a list of dicts to CSV string. Requires headers to determine column order. Panics if no headers are set.