Haskell program with self balancing tree. There are 3 types of nodes.