-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Read and write spreadsheets from and to CSV files in a lazy way
--   
--   Read and write spreadsheets from and to files containing comma
--   separated values (CSV) in a lazy way. Reading from other source than
--   plain <a>String</a>s could be easily added.
--   
--   If you install this package by
--   
--   <pre>
--   cabal install -fbuildExamples
--   </pre>
--   
--   then the example programs <tt>csvreplace</tt> and <tt>csvextract</tt>
--   are compiled and installed, too. The program <tt>csvreplace</tt> fills
--   a template text using data from a CSV file. For similar (non-Haskell)
--   programs see <tt>cut</tt>, <tt>csvfix</tt>, <tt>csvtool</tt>. The
--   program <tt>csvextract</tt> is the inverse of <tt>csvreplace</tt>.
--   
--   Related packages:
--   
--   <ul>
--   <li><tt>csv</tt>: strict parser</li>
--   <li><a>http://www.xoltar.org/languages/haskell.html</a>,
--   <a>http://www.xoltar.org/languages/haskell/CSV.hs</a>: strict
--   parser</li>
--   <li><tt>lazy-csv</tt>: lazy <tt>String</tt> and <tt>ByteString</tt>
--   parser</li>
--   <li><tt>cassava</tt>: high-level CSV parser that treats rows as
--   records, parses ByteStrings and is biased towards UTF-8 encoding.</li>
--   </ul>
@package spreadsheet
@version 0.1.3.8

module Data.Spreadsheet

-- | A spreadsheet is a list of lines, each line consists of cells, and
--   each cell is a string. Ideally, spreadsheets read from a CSV file have
--   lines with the same number of cells per line. However, we cannot
--   assert this, and thus we parse the lines as they come in.
type T = [[String]]

-- | <tt>fromString qm sep text</tt> parses <tt>text</tt> into a
--   spreadsheet, using the quotation character <tt>qm</tt> and the
--   separator character <tt>sep</tt>.
fromString :: Char -> Char -> String -> Exceptional UserMessage T

-- | <tt>fromString qm sep text</tt> parses <tt>text</tt> into a
--   spreadsheet and additionally returns text that follows after CSV
--   formatted data.
fromStringWithRemainder :: Char -> Char -> String -> Exceptional UserMessage (T, String)

-- | This is a quick hack. It does neither handle field nor line separators
--   within quoted fields. You must provide well-formed CSV content without
--   field and line separators within quotations. Everything else yields an
--   error.
fromStringSimple :: Char -> Char -> String -> T
type UserMessage = String
toString :: Char -> Char -> T -> String
toStringSimple :: Char -> Char -> T -> String
