Let's say I want to compute two lengthy processes in two separate threads in Haskell. However, I only care about the result of the first. How can I do it?
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]?
source share