This is a basic implementation of a red-black tree in F#, which is pretty close to being correct by construction.
failwith
elevateBlack
elevateRed