You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let map_branches t ~f =
let root_data = function
| Tree.Leaf l -> `Leaf l
| Tree.Node n -> `Node n.data
in
let rec traverse_node = function
| Tree.Leaf _ as l -> l
| Node n ->
Tree.node n.data (List1.map n.branches ~f:(traverse_branch n.data))
and traverse_branch parent_data (Branch bi) =
Tree.branch
(f parent_data bi.data (root_data bi.tip))
(traverse_node bi.tip)
in
traverse_node t
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: