summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
bf8d964)
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
let rec bind (u : 'a tree) (f : 'a -> 'b tree) : 'b tree =
match u with
let rec bind (u : 'a tree) (f : 'a -> 'b tree) : 'b tree =
match u with
- | 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 *)
| 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;;
type ('a, M) treeT =
'a tree M;;