changed my unit_M to Chris' convention of M_unit, for consistency
[lambda.git] / manipulating_trees_with_monads.mdwn
index 445722b..315cb68 100644 (file)
@@ -498,7 +498,7 @@ Okay, now let's do the same thing for our Tree monad.
 
        let rec bind (u : 'a tree) (f : 'a -> 'b tree) : 'b tree =
            match u with
-           | Leaf a -> (fun b -> Leaf b) (f a)
+           | Leaf a -> (fun b -> b) (f a) (* see below *)
            | Node (l, r) -> (fun l' r' -> Node (l', r')) (bind l f) (bind r f);;
 
        (* monadic operations for the TreeT monadic transformer *)