async
async copied to clipboard
Semigroup and Monoid instances for ConcurrentlyE
Added Semigroup and Monoid instances for ConcurrentlyE. They work by returning either the combination of the successes or the first failure. When the error type is Void—that is, impossible—they are equivalent to those of normal Concurrently.
The Monoid / Applicative instances for ConcurrentlyE can be useful to solve tasks like this one (taken from Reddit):
I wonder how I could evaluate a list "xs :: [IO (Maybe Int)]" in parallel and return just the first element which returns a "Just result" value after evaluation?