Say I want to compute two long running processes in two separate threads in Haskell. However, I only care about the result from the first one done. How would I do this?
Example (pseudo code):
thread1 = spark $ long_running some_arg1
thread2 = spark $ long_running some_arg2
result = first_done thread1 thread2 -- Maybe even first_done [thread1, thread2]?
The async package does this, and is now part of the Haskell Platform.