The Monad Challenges

PureScript Edition

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

MCPrelude documentation

This project is maintained by shaunplee and is a fork of the Monad Challenges maintained by mightybyte

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

Set 1: Random Numbers

It may not seem like the problems in this set have much to do with monads at first, but bear with us. We are taking you through the motivations for monads in a step by step structured way. It may be tempting to skip over this stuff. DON’T DO IT. Later problem sets build on things you did here. Stick with us and try to absorb the ideas and patterns.

  1. Random number generation
  2. Random character generation
  3. More generators
  4. Generalizing random pairs
  5. Generalizing lists of generators
  6. Threading the random number state

Next Page