clean up a bit
[lambda.git] / exercises / _assignment8.mdwn
index cd1dc08..a05707a 100644 (file)
@@ -11,7 +11,7 @@ relationships, as in
 See her 1999 paper for details.
 
 Here is [[code for the simple arithmetic reader monad discussed in the
 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
 `\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
@@ -44,3 +44,8 @@ When you have it working, try
     # match eval t2 with Leaf (Num f) -> f g;;
     - : int = 13
 
     # 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.