Read file problems

Frederic BELLOC belloc_f at epita.fr
Mon Sep 15 17:27:58 EDT 2003


Hal Daume III <hdaume at ISI.EDU> disait récemment :

> 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



More information about the Haskell-Cafe mailing list