Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Suggestion about balanced trees in stdlib
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-05-12 (15:19)
From: Dave Mason <dmason@s...>
Subject: Re: [Caml-list] Suggestion about balanced trees in stdlib
A less-dirty idea:

Sorry, I scanned Gerd's comment and deleted it.  I agree unifying Set
and Map would be good, but don't like the idea of *increasing* the
size of an existing module's data structure.  And I'm not crazy about
Stefano's dirty trick.  :-)

Gerd suggested that the int weighting factor could be turned into a
constructor.  Doing that would save the word that making a Set be a
unit Map would cost, so Set would be the same size as now, Map would
be smaller, and they'd be integrated.  (Yes, you could make Set yet
smaller, but this way that complexity (of constructors) is only in one

You could also save that extra word, and make it a little faster with
the ugly trick of using recursive records, where a record that points
to itself is the sentinel for Empty... but then the = operation
becomes non-terminating, so this isn't something that I think is worth
it in a stdlib kind of module.

Sorry if I missed something, and this is senseless mumbling...

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: