Summary
In this chapter, we have taken a further step in the functor–applicative hierarchy with monads. Monads model effects where the next step in a computation can depend on the previous step. This makes them very expressive for modeling effects, and they are often the go-to effect model for Haskell programmers. Besides the IO
monad, which we have already studied in a chapter of its own, we have reviewed several monads provided by the standard library here.
Chapter 12, Monad Transformers considers how we can combine multiple effects in the same monad. In the previous chapter, we saw two ways of combining applicative functors, namely products and compositions. Neither of these approaches is effective for monads. Instead, we require a new approach, called monad transformers, around which a framework has been created.