Recitation 16

  1. Why could it be advantageous to use the maybe monad (vs. using pattern matching on the option type)?

  2. It turns out that one can encode non-deterministic computations using a monad? We let t be a set that encodes all possible results. The return function produces a singleton set containing its argument. What should bind do? (No need to give code – it’s fine to be informal.)