[Haskell-cafe] Newbied question on IO Monad

Henning Thielemann lemming at henning-thielemann.de
Tue Sep 12 08:21:42 EDT 2006


On Tue, 12 Sep 2006, Sara Kenedy wrote:

> update :: String -> String
> update sss = ...
> 
> 
> main = do writeFile "myFile.txt" sss
>                x <- callSystem "myFile.txt"
>                y <- openFile "result.txt" ReadMode
>                zzz <- hGetContents y
>                return zzz
> 
> 
> I know that function main returns IO String, function update returns
> String. And my purpose is to get the string zzz from main for the
> value return of function update. But I do not know which way I can do.

http://haskell.org/hawiki/ThatAnnoyingIoType



More information about the Haskell-Cafe mailing list