I have a monadic function getRate:
getRate :: String -> IO Double
I'd like to map this function over a list of String's. Normally, I would just do:
mapM getRate ["foo", "bar"]
but since each call to getRate makes network calls, I'd like to parallelize the map so that each rate is fetched in a separate thread (or at least spread out among queues). I'm thinking of something like
parMapM getRate ["foo", "bar"]
but there is no parMapM function and parMap doesn't work with monadic functions.
What can I do?