You’ve seen how monads can be used to take values with contexts and apply them to functions, and how using
do notation allows you to focus on the values themselves, while Haskell handles the context for you.
You’ve met the
Maybe monad and seen how it adds a context of possible failure to values. You’ve learned about the list monad and seen how it lets us easily introduce nondeterminism into our programs. You’ve also learned how to work in the
IO monad, even before you knew what a monad was!
In this chapter, we’ll cover a few other monads. You’ll see how they can make your programs clearer by letting you treat all sorts of values as monadic ones. Further exploration of monads will also solidify your intuition ...