A purely functional red-black tree data structure