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 String
and GHCI happily displays the contents of the file. However neither of the
following work
print $ readFile "bla"
putStr $
Hayes
Cc: haskell-cafe@haskell.org
Sent: Thursday, September 24, 2009 6:02:18 PM
Subject: Re: [Haskell-cafe] Referring to Prelude.(++)
Did you try (Prelude.++)? I think that's the way it needs to be done.
Dan
On Thu, Sep 24, 2009 at 8:59 PM, Terry Hayes wrote:
> I'd like to red
I'd like to redefine (++) so that it works on a more general class of "lists"
(ListOf a). To do this, I found that I can import the Prelude hiding the
definition of (++). Then I want to make [] an instance of ListOf, and have the
(++) function call the built-in Prelude.(++).
My problem is tha