Utility functions for Erlang's gb_trees