Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jon Harrop <jon@jdh30.plus.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Objective Caml release 3.08.2
Date: Thu, 25 Nov 2004 21:47:30 +0000	[thread overview]
Message-ID: <200411252147.31167.jon@jdh30.plus.com> (raw)
In-Reply-To: <008001c4d319$693f0f40$b18780d9@mshome.net>

On Thursday 25 November 2004 18:05, Frédéric Gava wrote:
> > > Why an order for the fold operator ?
> > Because Set.t is an ordered container,
>
> Ok, but it is an abstract type : you do not know (except when you used
> ocamlbrowser) how it works...

The ability to fold over the elements of a set in order can be very useful. 
Consequently, when implementing a set data structure, the mathematical notion 
of a set is often supplemented with the added assurances that many functions 
over the set will operate in-order. This is typically achieved by 
implementing the set as a red-black balanced binary tree.

Other useful set implementations which do not present elements in-order are 
possible, most notably a hashed set because it has significantly better 
average-case performance.

Cheers,
Jon.


  parent reply	other threads:[~2004-11-25 21:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-24 13:06 Damien Doligez
2004-11-25 14:47 ` [Caml-list] " Frédéric Gava
2004-11-25 15:53   ` skaller
2004-11-25 18:05     ` Frédéric Gava
2004-11-25 18:32       ` Christophe TROESTLER
2004-11-26 23:10         ` Frédéric Gava
2004-11-25 21:47       ` Jon Harrop [this message]
2004-11-25 23:34       ` skaller
2004-11-26  8:45         ` Frédéric Gava
2004-11-26  1:20 ` Aleksey Nogin

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=200411252147.31167.jon@jdh30.plus.com \
    --to=jon@jdh30.plus.com \
    --cc=caml-list@yquem.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