Bind runs an initial parallel computation, then uses its result to generate the next computation. The second computation need not exist until that result is available, so the operation is more general than choosing among preexisting containers or branches. section 7.4
From choice to flatMap
A conditional computation can be generalized from choice to chooser: pa.flatMap(f) runs pa, then applies f to its result to obtain the next Par computation. The next computation is therefore constructed from the first result rather than selected from a fixed collection. section 7.4
extension [A](pa: Par[A]) def flatMap[B](f: A => Par[B]): Par[B]
Inspect the flatMap signature that expresses bind for parallel computations. section 7.4
Related algebraic exercises include:
- Use join to implement flatMap by mapping into a nested Par and flattening it. section 7.4
- Use flatMap to implement join, then express map2 using flatMap and unit. section 7.4




