See her 1999 paper for details.
Here is [[code for the simple arithmetic reader monad discussed in the
-lecture notes|code/arithmetic1.ml]]. It computes
+lecture notes|code/arith1.ml]]. It computes
`\x. (+ 1 (* (/ 6 x) 4))`. Your task is to modify it to compute
`\x\y.(+ 1 (* (/ 6 x) y))`. You will need to modify five lines.
The first one is the type of a boxed int. Instead of `type num = int
# match eval t2 with Leaf (Num f) -> f g;;
- : int = 13
+3. Add in the maybe monad. Start here:
+
+ type num = env -> int option
+
+ Show that your code handles division by zero gracefully.