Hal Daume III <[EMAIL PROTECTED]> 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 does
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'
HI,
I have a recurrent probleme with function readFile and Monad :
it is that i try to get a line, transform it and stock it in a list
and what i want is that function return me the list.
But hugs say me that in
readFile my_file >>= \s -> map cons_line (lines s)
readFile is a IO String type but i