
14 Jun
2006
14 Jun
'06
5:50 a.m.
Nuno,
I have this function which write a file:
writeHtml b x y = do writeFile (b ++ ".html") (htmlCode b x y)
i need to apply to each member of a given list:
Have a look at the mapM and mapM_ functions from the Prelude. Instantiated to IO, these have the following types: mapM :: (a -> IO b) -> [a] -> IO [b] mapM_ :: (a -> IO b) -> [a] -> m () HTH, Stefan