September 2023
Intermediate to advanced
470 pages
11h 12m
English
The exercises in this chapter will focus on how to use monads.
Here is your friendly reminder that nobody can learn functional programming by just reading code, and the best way to learn is by practicing. You can refer to the exercises folder in the book code repository for the starting point and some hints.
We wrote some tests to verify monad laws for Outcome and List. For this exercise, you need to write the same three tests for our ContextReader monad, one for each law.
In our monads, we implemented join in function of bind. It’s also possible to do the opposite. For this exercise, try to reimplement ContextReader.join without using bind and then ...
Read now
Unlock full access