changes
[lambda.git] / exercises / assignment8-9.mdwn
index 8eb4bc7..fbdeb85 100644 (file)
@@ -14,26 +14,27 @@ relationships, as in
 
         John_x thinks Mary_y said he_x likes her_y.
 
 
         John_x thinks Mary_y said he_x likes her_y.
 
-    See her 1999 paper for details.
+    See her 1999 paper for details. Essentially, she ends up layering several
+Reader monads over each other.
 
     Here is [[code for the arithmetic tree Chris presented in week 8|code/arith1.ml]]. It computes
 
     Here is [[code for the arithmetic tree Chris presented in week 8|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.
+`\n. (+ 1 (* (/ 6 n) 4))`.  Your task is to modify it to compute
+`\n m. (+ 1 (* (/ 6 n) m))`.  You will need to modify five lines.
 The first one is the type of a boxed int.  Instead of `type num = int
 -> int`, you'll need
 
         type num = int -> int -> int
 
     The second and third are the definitions of `mid` and `map2`. The fourth
 The first one is the type of a boxed int.  Instead of `type num = int
 -> int`, you'll need
 
         type num = int -> int -> int
 
     The second and third are the definitions of `mid` and `map2`. The fourth
-is the one that encodes the variable `x`, the line that begins `(Leaf
-(Num (fun x -> ...`.  The fifth line you need to modify is the one
-that replaces "4" with "y".  When you have these lines modified,
+is the one that encodes the variable `n`, the line that begins `(Leaf
+(Num (fun n -> ...`.  The fifth line you need to modify is the one
+that replaces "4" with "m".  When you have these lines modified,
 you should be able to execute the following expression:
 
         # match eval t2 with Leaf (Num f) -> f 2 4;;
         - : int = 13
 
 you should be able to execute the following expression:
 
         # match eval t2 with Leaf (Num f) -> f 2 4;;
         - : int = 13
 
-2. Based on the evaluator code from the assignment from week 7, and what you've learned about the Reader monad,
+2. Based on [[the evaluator code from assignment 7|/exercises/assignment7/#index3h2]], and what you've learned about the Reader monad,
 enhance the arithmetic tree code to handle an arbitrary set of free variables. Don't use Juli8 libraries for this; just do it by hand.
 Return to the original code (that is, before the modifications required by the previous problem).
 
 enhance the arithmetic tree code to handle an arbitrary set of free variables. Don't use Juli8 libraries for this; just do it by hand.
 Return to the original code (that is, before the modifications required by the previous problem).