projects
/
lambda.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bf8d964
)
manip trees tweaks
author
Jim Pryor
<profjim@jimpryor.net>
Thu, 2 Dec 2010 16:34:34 +0000
(11:34 -0500)
committer
Jim Pryor
<profjim@jimpryor.net>
Thu, 2 Dec 2010 16:34:34 +0000
(11:34 -0500)
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
manipulating_trees_with_monads.mdwn
patch
|
blob
|
history
diff --git
a/manipulating_trees_with_monads.mdwn
b/manipulating_trees_with_monads.mdwn
index
315cb68
..
ba990d1
100644
(file)
--- 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 -> b) (f a) (* see below *)
+ | 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;;