Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Stefan Monnier <monnier+lists/caml/news/@tequila.cs.yale.edu>
To: caml-list@inria.fr
Subject: Re: polymorphically comparable Maps?
Date: 23 Feb 1999 11:49:33 -0500	[thread overview]
Message-ID: <5lww199iaq.fsf@tequila.cs.yale.edu> (raw)
In-Reply-To: <14033.38333.652607.941379@heplix4.ikp.physik.tu-darmstadt.de>

>>>>> "Thorsten" == Thorsten Ohl <ohl@hep.tu-darmstadt.de> writes:
> library) with the property that identical maps will have an identical
> representation?  Sorted association lists work, but have linear access
> and insertion.  Is there something logarithmical (even with an OCaml
> implementation)?

I can't think of any obvious good answer, but if you can live with explicit
`canonicalization' (linear time) steps in order to then get logarithmical
access and identical representation, then some kind of binary tree can do the
job.
Of course, equality comparison (although simple thanks to the identical
representation) will still be linear, so it doesn't buy you much since
equality comparisons of non-balanced binary trees (or pretty much any map of
ordered types) can also be done fairly simply in linear time.

So why exactly do you want that representation to be `identical' ?


	Stefan




  parent reply	other threads:[~1999-02-23 16:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-22 17:37 Thorsten Ohl
1999-02-22 18:20 ` Jean-Francois Monin
1999-02-23 16:49 ` Stefan Monnier [this message]
1999-02-23 17:28   ` Adam P. Jenkins
1999-02-23 18:10   ` Thorsten Ohl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5lww199iaq.fsf@tequila.cs.yale.edu \
    --to=monnier+lists/caml/news/@tequila.cs.yale.edu \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox