
8 Sep
2014
8 Sep
'14
7:01 a.m.
Are you looking for something like amb/unamb? [0] In particular, if you look at the comments in the source for 'race', it should be pretty intuitive how to go from there to "run x computations, kill the remaining ones after y return". You just need to fiddle with the MVar, possibly adding another thread and MVar that represents whether the calculation can already be completed. [0] https://hackage.haskell.org/package/unamb-0.2.5/docs/src/Data-Unamb.html#amb