A Future represents the eventual result of asynchronous computation. The ordinary java.util.concurrent.Future exposes get, so retrieving its value can block the current thread; a non-blocking design instead registers a callback for the result. section 7.3.4
opaque type Future[+A] = (A => Unit) => Unit #1 opaque type Par[+A] = ExecutorService => Future[A] #2
The callback encoding makes the result opaque: applying an ExecutorService produces a function that accepts an A => Unit continuation. section 7.3.4
The callback-based representation supports several layers of asynchronous composition:
- fork schedules deferred computation on an ExecutorService without calling a blocking method. section 7.3.4
Running a large parallel computation
A non-blocking Par can map math.sqrt across List.range(1, 100000) and later run the computation on a fixed thread pool, producing a List[Double].







