
28 Jan
2011
28 Jan
'11
7:20 p.m.
The first and third work, but not the second. Why? Michael ============== f :: String -> IO () f s = do putStrLn s {- g :: [String] -> IO () g l = do s <- l putStrLn s -} {- h :: [Int] -> [Int] h l = do i <- l return (i+1) -} ============== serialize2.hs:29:9: Couldn't match expected type `[String]' against inferred type `IO String' In a stmt of a 'do' expression: s <- l In the expression: do { s <- l; putStrLn s } In the definition of `g': g l = do { s <- l; putStrLn s }