[Haskell-beginners] IO action on a list of [IO a]

Manfred Lotz manfred.lotz at arcor.de
Sat Oct 6 16:16:18 CEST 2012


Hi all,
I want to do an IO action on a list of [IO a] like this:

myfor :: (a -> IO () ) -> [IO a] -> IO ()
myfor _ [] = return ()
myfor f (x:xs) = do 
  x' <- x
  f x'
  myfor f xs
    


Is there a library function doing just this?



-- 
Thanks,
Manfred





More information about the Beginners mailing list