X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=manipulating_trees_with_monads.mdwn;h=ba990d10b63229290fa195be8cf24c967a084593;hp=445722bebc24e1334fb6fddc506108e61894ea44;hb=12830f839dda3c46101812c38f5cb6d3926aa623;hpb=b1d420acee7b904af41aabe6db71e872baf251f5 diff --git a/manipulating_trees_with_monads.mdwn b/manipulating_trees_with_monads.mdwn index 445722be..ba990d10 100644 --- a/manipulating_trees_with_monads.mdwn +++ b/manipulating_trees_with_monads.mdwn @@ -498,10 +498,11 @@ 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 -> f a;; | Node (l, r) -> (fun l' r' -> Node (l', r')) (bind l f) (bind r f);; (* monadic operations for the TreeT monadic transformer *) + (* NOTE THIS IS NOT YET WORKING --- STILL REFINING *) type ('a, M) treeT = 'a tree M;;