From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA26933; Sun, 25 Jul 2004 18:53:20 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA26731 for ; Sun, 25 Jul 2004 18:53:19 +0200 (MET DST) Received: from herd.plethora.net (herd.plethora.net [205.166.146.1]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6PGrIEV001158 for ; Sun, 25 Jul 2004 18:53:18 +0200 Received: from bhurt.plethora.net (bhurt.plethora.net [205.166.146.49]) by herd.plethora.net (8.11.6/8.10.1) with ESMTP id i6PGrEo00421; Sun, 25 Jul 2004 11:53:14 -0500 (CDT) Date: Sun, 25 Jul 2004 12:01:03 -0500 (CDT) From: Brian Hurt X-X-Sender: bhurt@localhost.localdomain To: Martin Jambon cc: caml-list@inria.fr Subject: Re: [Caml-list] Map + Set In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at nez-perce with ID 4103E57E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 val:01 elt:01 elt:01 val:01 int:01 modules:02 jambon:02 module:03 module:03 wrote:03 interface:03 data:03 redirect:95 efficiency:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sun, 25 Jul 2004, Martin Jambon wrote: > Hi, > > I need a functional data structure that has a decent efficiency (i.e. > not lists) and can represent `sets of named containers' so that I can > find a container in a set, remove it from the set, update it and put it > back into the set. > Normally the Map module should be suitable, but it doesn't > provide set operations over the keys (union, inter, diff, ...). > The Set module is almost enough except that it doesn't provide a find > function: > > val find : elt -> t -> elt (* yes! *) A better interface might be: val find: (elt -> int) -> t -> elt There is a lot of functionality I'd like to be able to add to map and set. I find myself reimplementing them on a regular basis myself (and no, I haven't thought of a better solution). Many people on this list don't like modules, however. -- "Usenet is like a herd of performing elephants with diarrhea -- massive, difficult to redirect, awe-inspiring, entertaining, and a source of mind-boggling amounts of excrement when you least expect it." - Gene Spafford Brian ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners