In Chapter 6, Exploring Built-In Effects, we looked at standard effects and promised to reveal the truth about the concepts underlying them; we also discussed the topic of combining them. Since then, we have discussed algebraic structures, such as monoids and groups, functors, applicatives, and monads, delivering on our first promise. But the composition topic has remained uncovered all this time.
In Chapter 8, Dealing with Effects, we implemented a general way to compose applicatives—which is very useful on its own, but can't help us with combining the standard effects of a monadic nature.
In this chapter, we will finally take on and keep our second promise by discussing some ways to bring different monadic effects together. We will look at the complications related to that and some of the solutions used in the Scala community...