← all modules

Std.Csv

Std.Csv
  Std.Csv — CSV encode + decode (Layer 3 Sky source).

Types
  type alias Csv

Values
  defaultCsv : Csv
      `defaultCsv` — empty CSV document (no header, no rows).  Builder
  encode : Csv -> String
      `encode csv` — encode `csv` back to a comma-delimited string.
  encodeWithDelimiter : String -> Csv -> String
      `encodeWithDelimiter delim csv` — like `encode` but with a
  parse : String -> Result Error Csv
      `parse text` — parse `text` as comma-delimited CSV.  The first
  parseStreamFromFile : String -> Task Error (List (List String))
      `parseStreamFromFile path` — stream-read a CSV file into
  parseWithDelimiter : String -> String -> Result Error Csv
      `parseWithDelimiter delim text` — like `parse` but with a
  withHeader : List String -> Csv -> Csv
      `withHeader ["id", "email"] csv` — replace the header row.
  withRows : List (List String) -> Csv -> Csv
      `withRows [["1", "a@example.com"], ["2", "b@example.com"]] csv`