[Haskell-cafe] Text.CSV questions

Michael Snoyman michael at snoyman.com
Fri Jun 17 11:02:42 CEST 2011


On Fri, Jun 17, 2011 at 12:00 PM, Dmitri O.Kondratiev <dokondr at gmail.com> wrote:
> Hi,
> I try to parse csv file with Text.CSV, like this:
>
> import Text.CSV
> import System
>
> main = do
>      [inpFileName] <- getArgs
>      putStrLn ("Parsing "++inpFileName++"...")
>      let result = parseCSVFromFile inpFileName
>      print result
>
>
> === As a result I get:
>
>  No instance for (Show
>                     (IO (Either Text.Parsec.Error.ParseError CSV)))
>    arising from a use of `print'
>  Possible fix:
>    add an instance declaration for
>    (Show (IO (Either Text.Parsec.Error.ParseError CSV)))
>
> === Question:
> How to add a Show instance for "(IO (Either Text.Parsec.Error.ParseError
> CSV)))" ?
>
> Thanks!
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>

I think what you want is:


> main = do
>      [inpFileName] <- getArgs
>      putStrLn ("Parsing "++inpFileName++"...")
>      result <- parseCSVFromFile inpFileName
>      print result

Michael



More information about the Haskell-Cafe mailing list