use red-black tree in functional compiler