
15 Sep
2003
15 Sep
'03
10:27 a.m.
Hal Daume III
Hi,
This is a pretty simple problem to fix. (>>=) has type IO a -> (a -> IO b) -> IO b. 'readFile my_file' has type IO String, so this means whatever comes on the RHS of >>= should have type (String -> IO b). In your case, it doesn't. It has type String -> [something], but the [something] isn't an IO type.
Hint: you need to put a call to 'return' in there.
Yes, thanks ps : i've read something like that in the Monad Tutorial but i was not sure... http://www.nomaware.com/monads/html/index.html -- C, socks and sun ;-) No haskell bug :-D