We had a whirlwind tour of traversals in this chapter. We looked at functional combinators and how looping is way different from the traditional Java
for loop. We also played with many examples of
for comprehension is a syntactic sugar that hides the complexity arising out of combining combinators. A running validation example delved into the nitty-gritty of the de-sugaring of the
This know-how prepared us to better appreciate
flatMap, the glue that binds a pipeline of computations, aka the monad pattern. We saw how the
for comprehension realizes monad and what happens behind the scenes. In addition, we had a detailed look at the
reduce combinator and its left and right ...