Monads can be seen and taught from many perspectives. The mathematics behind them is just one perspective, and we’ll ignore it by focusing on the functionality monads provide. Monads can simplify our code by promoting coherent abstraction and guarantees of the uniformity of the code. In this chapter, we’ll talk about using monads in practice. We’ll see how they help us to implement difficult algorithms clearly and correctly and to write short and concise code while maintaining readability and ease of support.
This is the approach of this chapter: we’ll look at cases and apply monads to them. It makes sense to refresh the idea of abstracting computations from chapter 2 before reading this chapter.