What is the best way to perform a map inside IO? I defined the following function, but this must be common enough to warrant something in the standard library. What am I missing?

-Tom

mapIO :: (a -> IO b) -> [a] -> IO [b]
mapIO _ [] = return []
mapIO f (x:xs) = do y <- f x
                    ys <- mapIO f xs
                    return (y : ys)
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to