On Oct 5, 2009, at 17:45 , Terry Hayes wrote:
I found the handling of (IO t) by the interpreter (GHCI in my case) to be somewhat confusing. As pointed out below, I can type:readFile "bla" :: IO Stringand GHCI happily displays the contents of the file. However neither of the following workprint $ readFile "bla" putStr $ readFile "bla"In other words, GHCI seems perfectly willing to "unwrap" a type (IO t) and display it (assuming Show t). This bit of helpfulness may just confuse us novice users by allowing us to stray from the correct way to deal with wrapped types (monads).
There's always :set -fno-print-bind-contents, which like -fno- monomorphism-restriction might make a good GHCi default.
-- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [email protected] system administrator [openafs,heimdal,too many hats] [email protected] electrical and computer engineering, carnegie mellon university KF8NH
PGP.sig
Description: This is a digitally signed message part
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
