Re: [Haskell-cafe] map applications

2005-08-19 Thread Cale Gibbard
Well, here is your problem: map :: (a -> b) -> [a] -> [b] putStrLn :: String -> IO () qlist :: [String] map putStrLn :: [String] -> [IO ()] map putStrLn qlist :: [IO ()] The type of (map putStrLn qlist) is not of the form IO a, so it's not an action which can be run. There are some useful prelude

[Haskell-cafe] map applications

2005-08-19 Thread Brian McQueen
I have a simple list like this: qlist = ["ll", "kkk", "d"] Why is it OK to do this: qwrap [] = putStrLn ":" qwrap (a:as) = do putStrLn a qwrap as qwap qlist but not this: map putStrLn qlist What is going on in the map function? McQueen __