August 2018
Intermediate to advanced
380 pages
10h 2m
English
In the previous chapter, we have already seen flatMap in the context of the Try type. It was conceptualized as a continuation of a computational that may result in an error. We can extrapolate this conceptualization to the case of Futures. The same way as flatMap was a conceptualization of a continuation of an error-prone computation in the case of Try, it is a continuation of an asynchronous computation in the case of Future.
The role of the flatMap function is more or less the same in the case of any effect type you deal with. It is a continuation of a computation that produces a side effect with another computation that produces the same side effect, but requires the result of the first computation to proceed.
Similarly ...