[Haskell-cafe] Re: Red-black trees as a nested datatype

Jim Apple jbapple+haskell-cafe at gmail.com
Thu Dec 28 03:03:12 EST 2006


Correction:

type RedBlackTree a =
    Tree a
    -- A red tree with two levels of black nodes is just a red node on
    -- top of two two-level black nodes.
    (Node a (Black2 a)) (Black2 a) a ()

> type RedBlackTree a =
>     Tree a
>     -- A red tree with two levels of black nodes is just a red node on
>     -- top of two black nodes.
>     (Node (Black2 a) a) (Black2 a) a ()


More information about the Haskell-Cafe mailing list