Thanks!The use case is a voting system: people can vote at whatever moment, but sometime the result of the vote is known even if not everybody voted yet.This is working fine, but I'd like a way to generalize this, especially to generalize the list to any structure...This takes a list of events and a function. The events can fire at whatever moment, and as soon as one of the events fires, the function is called with the results available so far. If the function returns Just, the remaining events are cancelled and the final result is returned.I want several things to be computed in parallel. Those computations will not finish at the same time, but as soon as enough result is gathered, the remaining computations can be cancelled and the final result computed.Hi guys!I'm wondering if there is an abstraction (for example a typeclass) for parallel interruptible computations.Clearly a Monad is not suited here: Monad are by definition for sequential computation (since the result of the first computation is fed to the next).
-> So the question is: is there an abstraction for parallel computations?
Note that I'm not interrested with real implementations (such as with threads) but with the abstraction.For now I came up with:ShortcutEvents :: [Event a] -> ([a] -> Maybe b) -> Event b
Corentin