+(* no empty tree, must have one root at least *)
+type 'a treeref =
+ | NodeRef of 'a * 'a treeref list ref
+
+val treeref_node_iter:
+ (('a * 'a treeref list ref) -> unit) -> 'a treeref -> unit
+val treeref_node_iter_with_parents:
+ (('a * 'a treeref list ref) -> ('a list) -> unit) ->
+ 'a treeref -> unit
+
+val find_treeref:
+ (('a * 'a treeref list ref) -> bool) ->
+ 'a treeref -> 'a treeref
+
+val treeref_children_ref:
+ 'a treeref -> 'a treeref list ref
+
+val find_treeref_with_parents_some:
+ ('a * 'a treeref list ref -> 'a list -> 'c option) ->
+ 'a treeref -> 'c
+
+val find_multi_treeref_with_parents_some:
+ ('a * 'a treeref list ref -> 'a list -> 'c option) ->
+ 'a treeref -> 'c list
+
+
+(* Leaf can seem redundant, but sometimes want to directly see if