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 KAA11559; Sun, 25 Jul 2004 10:18:11 +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 KAA07270 for ; Sun, 25 Jul 2004 10:18:10 +0200 (MET DST) Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6P8I9EV022086 for ; Sun, 25 Jul 2004 10:18:10 +0200 X-Sasl-enc: 0oHi1mPaOhgi87FEyQCLwQ 1090743487 Received: from [192.168.1.100] (unknown [218.81.123.16]) by mail.messagingengine.com (Postfix) with ESMTP id 7B210C12303 for ; Sun, 25 Jul 2004 04:18:06 -0400 (EDT) Date: Sun, 25 Jul 2004 16:17:55 +0800 (HKT) From: Martin Jambon X-X-Sender: martin@localhost To: caml-list@inria.fr Subject: [Caml-list] Map + Set Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at nez-perce with ID 41036CC1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; val:01 elt:01 elt:01 mli:01 jambon:02 jambon:02 module:03 module:03 data:03 efficiency:05 structure:06 functional:06 lists:91 keys:08 operations:08 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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! *) Finally I just copy-pasted set.mli and set.ml and inserted a find function... but is there a better solution? Martin ------------------- 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