The Monad Challenges

A set of challenges for jump starting your understanding of monads.

Outline

Set 1: Random Numbers

Set 2: Failing Computations

Set 3: Combinations

Set 4: Common Abstraction

Set 5: Do Notation

This project is maintained by mightybyte

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Using the abstraction

Now your Set4.hs module has fairly decent set of abstract tools all built on the Monad interface. Now go back through sets 1, 2, and 3 and redo them all using the library of functions you built up in Set4.hs. Since Gen is now a newtype you will have to make some changes to the functions that use it. This may seem like a waste of time, but it will develop your familiarity with the names actually used by Haskell’s monad library. This is the core of developing a working knowledge of monads. The first three sets were the motivation. Now we’re getting to the real world use.

Previous Page - Next Page