[Haskell-beginners] help me with eroor

Lorenzo Bolla lbolla at gmail.com
Sat Oct 15 11:15:31 CEST 2011


You need a main function, like:

main = do
    x <- getContents
    putStrLn $ parseCSV x


(This would read a string from stdin and pass it to parseCSV; then it would
print the result to stdout.)

L.



On Fri, Oct 14, 2011 at 8:59 PM, kolli kolli <nammukolli04 at gmail.com> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20111015/cc307371/attachment.htm>


More information about the Beginners mailing list