:: Bool -> a -> a -> a package:parameterized-utils
balanceL p l r returns a balanced tree for the sequence l
++ [p] ++ r.
It assumes that l and r are close to being balanced,
and that only l may contain too many elements.
balanceR p l r returns a balanced tree for the sequence l
++ [p] ++ r.
It assumes that l and r are close to being balanced,
and that only r may contain too many elements.
link is called to insert a key and value between two disjoint
subtrees.