manip trees tweaks
[lambda.git] / manipulating_trees_with_monads.mdwn
index 3b43c9a..e7cccec 100644 (file)
@@ -265,10 +265,10 @@ We use the continuation monad described above, and insert the
 
 So for example, we compute:
 
-       # tree_monadize (fun a -> fun k -> a :: (k a)) t1 (fun t -> []);;
+       # tree_monadize (fun a -> fun k -> a :: k a) t1 (fun t -> []);;
        - : int list = [2; 3; 5; 7; 11]
 
-We have found a way of collapsing a tree into a list of its leaves. Can you trace how this is working? Think first about what the operation `fun a -> fun k -> a :: (k a)` does when you apply it to a plain `int`, and the continuation `fun _ -> []`.
+We have found a way of collapsing a tree into a list of its leaves. Can you trace how this is working? Think first about what the operation `fun a -> fun k -> a :: k a` does when you apply it to a plain `int`, and the continuation `fun _ -> []`. Then given what we've said about `tree_monadize`, what should we expect `tree_monadize (fun a -> fun k -> a :: k a` to do?
 
 The continuation monad is amazingly flexible; we can use it to
 simulate some of the computations performed above.  To see how, first