[Haskell-cafe] GHCi shows result of (IO a) only if (a) is in class Show

Daniel van den Eijkel dvde at gmx.net
Sat Apr 25 12:21:01 UTC 2015

I wrote a parser and it took me a while to realize why GHCi suddenly did
not show any result nor an error message anymore.

My parsing function has type (IO Expression), Expression is in class Show.

After changing the parser to (IO Declaration), it did not show anything
anymore, because Declaration was not in class Show.

When I typed (parseFile "input.txt" >>= print), I got the error message
and understood what was going on. But for I while I was really confused
what's happening.

Just wanted to share this.


More information about the Haskell-Cafe mailing list