A red-black tree has some constraints:
- A node is either red or black.
- The root is black.
- All leaves are black.
- Both children of every red node are black.
- Every simple path from a given node to any of its descendant leaves contains the same number of black nodes.
Using the declarations in RBTree.hs, all these five constraints are implemented.
I found a complete implementation here on Github.