[Haskell-beginners] help me with eroor

Brent Yorgey byorgey at seas.upenn.edu
Sat Oct 15 00:35:41 CEST 2011


By the way, if you need a CSV parser, there are several already on
Hackage: 'csv' [1] is the simplest; for more sophisticated uses there
are also bytestring-csv [2] and csv-enumerator [3].

But perhaps you are just writing a CSV parser in order to learn
Parsec; in which case, by all means carry on!

-Brent

[1] http://hackage.haskell.org/package/csv
[2] http://hackage.haskell.org/package/bytestring-csv
[3] http://hackage.haskell.org/package/csv-enumerator


On Fri, Oct 14, 2011 at 01:59:22PM -0600, kolli kolli wrote:
> import Text.ParserCombinators.Parsec
> 
> csvFile = endBy line eol
> line = sepBy cell (char ',')
> cell = many (noneOf ",\n")
> eol = char '\n'
> 
> parseCSV :: String -> Either ParseError [[String]]
> parseCSV input = parse csvFile "(unknown)" input
> 
> *showing error:
> <interactive>:1:32: Not in scope: `main'
> *

> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners




More information about the Beginners mailing list