5 Monads as practical functionality providers
This chapter covers
- A pragmatic approach to monads and the functionality they provide
- Accessing configuration, writing logs, and maintaining state with monads
- Exploiting various approaches to mutability in the
IO
andST
monads
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 ...
Get Haskell in Depth now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.