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

Michael Orlitzky michael at orlitzky.com
Sun Oct 7 20:05:23 CEST 2012


On 10/07/2012 12:41 PM, Christopher Howard wrote:
> 
> For the curious newbies among us: Why would you want to perform an IO
> action on a list of IO actions?

Let's say you have a list of URLs, and you map,

  downloadUrl :: URL -> IO Stuff

over that list. The result will be a list, [IO Stuff]. Now suppose you
want to print them all one at a time. Printing is an IO action, so this
is performing an IO action (print) on a list of IO "actions" (downloaded
URLs).



More information about the Beginners mailing list