© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
A. Serrano MenaPractical Haskellhttps://doi.org/10.1007/978-1-4842-8581-7_7

7. More Monads: Now for Recommendations

Alejandro Serrano Mena1  
(1)
Utrecht, The Netherlands
 

The previous chapter introduced monads. In particular, the tasks of handling errors using Maybe, constants using Reader, logging using Writer, and state were presented through the same point of view, making clear how monad functions form the scaffolding that combines code for all of them.

The list monad can also represent multiple outcomes of a function. This is useful for modeling paths between years in time machines . However, you must be careful to ensure that the code does not enter an ...

Get Practical Haskell: A Real-World Guide to Functional Programming 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.