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

Christopher Howard christopher.howard at frigidcode.com
Sun Oct 7 18:41:32 CEST 2012


On 10/06/2012 06:16 AM, Manfred Lotz wrote:
> 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?
> 
> 
> 

For the curious newbies among us: Why would you want to perform an IO
action on a list of IO actions?

-- 
frigidcode.com
indicium.us

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 551 bytes
Desc: OpenPGP digital signature
URL: <http://www.haskell.org/pipermail/beginners/attachments/20121007/332127c8/attachment.pgp>


More information about the Beginners mailing list