Balanced binary tree in Haskell

Quote:

>I'm trying to make a binary tree in Haskell, which is not so hard. But

>the problem is finding an algorithm that balances the tree.

>Any algorithm for making binary trees balanced will be greatly

>appreciated.

There's a partial implementation of red-black trees in ML in the

lexical analyzer generator for SML. Map and Set in the stdlib of

OCaml have balanced trees too (I don't know what kind). Perhaps you

could munge one of these into Haskell...

-- Rob.