(* An Ocaml program *) (* Inserting an element into a balanced tree *) type btype = LeftLean | RightLean | Balanced | Leaf and 'a tree = {key: 'a; tag: btype; left: 'a node; right: 'a node} and 'a node = Tree of 'a tree | Empty;; let gulp tr e = match tr with | {key = k; tag = Balanced; left = l; right = r} -> k;;