Hi Niklas and Patrick,

Thankyou both for the comments -- this is what I am looking for. 

I have a follow-on question, if I have code like

getPages :: IO()
getPages = do (page1, page2, page3)
     <- runConcurrently $ (,,)
     <$> Concurrently (getURL "url1")
     <*> Concurrently (getURL "url2")
     <*> Concurrently (getURL "url3")

main :: IO()
main = do 
    f <- async getPages
    cancel f

Am I guaranteed the the getURL() calls will definitely have either finished, or cancel? (I looked through the source (https://hackage.haskell.org/package/async-2.2.2/docs/src/Control.Concurrent.Async.html#Concurrently), and I think so, because runConcurrently is implemented in terms of race, which is implemented using withAsync, but I'm not confident with interpreting Haskell!)


Many thanks,

Mike



On Wed, 18 Mar 2020 at 03:15, Niklas Hambüchen <mail@nh2.me> wrote:
I've you're new to async, also check out my recent rework of the docs that talk about this topic specifically:

https://github.com/simonmar/async/pull/105/files

(To be available in the next release of async.)