Brodal et al. demonstrated in their ESA '06 paper the existence of a purely functional structure with logarithmic-time search, update and insertion, and constant-time merge. (Note I'm not talking about Brodal heaps, which are a different data structure, quite widely used to implement purely functional priority queues.) This seems to be a very lucrative result, and should lead to efficient purely functional sets and maps, but I don't see them used anywhere:
- Haskell's
containers
uses Adams trees; - OCaml standard library uses AVL trees;
- Scala's immutable sorted maps are implemented using red-black trees.
If Brodal trees really have such good results, why have they not been adapted into mainstream functional programming languages standard libraries? In fact, I have not seen even one implementation of Brodal trees at all!
Specifically, is this because:
- they are very hard (or in fact nearly impossible) to implement correctly;
- the constants are very large, and real gains seem small;
- other reasons;
- or a combination of the aforementioned?