[Haskell-cafe] Parallel interruptible computations

Julian K. Arni jkarni at gmail.com
Mon Sep 8 11:01:36 UTC 2014


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


More information about the Haskell-Cafe mailing list