That’s a mouthful: use a wrapper
Tree of {tree: ‘a tr, eq: ‘a* ‘ a -> bool, lt: ‘a* ‘ a -> bool};
- fun make_tree eq_fn lt_fn = Tree{tree=Empty,eq=eq_fn,lt=lt_fn};
val make_tree = fn : (‘a*‘a->bool) -> (‘a*‘a->bool) -> ‘a tree;
- fun insert x (Tree {tree=tr,eq_fn=fn,lt_fn=lt}) =
Tree{tree=ins eq_fn lt_fn x tr, eq=eq_fn,lt=lt_fn};
val insert = fn : ‘a -> ‘a tree -> ‘a tree;