caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Canonical Set/Map datastructure?
@ 2008-03-05 16:49 Berke Durak
  2008-03-05 17:16 ` [Caml-list] " Brian Hurt
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Berke Durak @ 2008-03-05 16:49 UTC (permalink / raw)
  To: Caml-list List

The Map and Set modules use AVL trees which are efficient but not canonical - a given
set of elements can have more than one representation.  This means that you cannot use
ad hoc comparison on sets and maps, and this is why they are presented as functors.

Does anyone know if, in the many years that have passed since the implementation of
those fine modules, someone has invented a (functional) datastructure that is as
efficient while being canonic?

That would permit polymorphic set and map modules that work correctly on sets of sets, for
instance.  Of course, the order induced on sets by the adhoc comparison doesn't have to
be a useful order; just being a good order would suffice.
-- 
Berke DURAK


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-03-07 17:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-05 16:49 Canonical Set/Map datastructure? Berke Durak
2008-03-05 17:16 ` [Caml-list] " Brian Hurt
2008-03-05 17:27 ` Alain Frisch
2008-03-05 19:53   ` Jean-Christophe Filliâtre
2008-03-05 20:03   ` Jon Harrop
2008-03-05 21:56     ` Alain Frisch
2008-03-06  7:45     ` Jean-Christophe Filliâtre
2008-03-05 17:34 ` Harrison, John R
2008-03-06  9:53 ` Berke Durak
2008-03-06 17:36   ` Harrison, John R
2008-03-07 10:09     ` Berke Durak
2008-03-07 17:13       ` Harrison, John R
2008-03-07 10:19   ` Alain Frisch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).