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 UAA28704; Tue, 4 Nov 2003 20:38:12 +0100 (MET) 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 UAA28978 for ; Tue, 4 Nov 2003 20:38:11 +0100 (MET) Received: from bob.west.spy.net (mail.west.spy.net [66.149.231.226]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hA4JcA104451 for ; Tue, 4 Nov 2003 20:38:10 +0100 (MET) Received: from [10.9.254.248] (sjc-dist3-e3.2wire.com [63.203.253.2]) by bob.west.spy.net (Postfix) with ESMTP id 931795706; Tue, 4 Nov 2003 11:38:01 -0800 (PST) In-Reply-To: <20031104093905.GF24152@st> References: <20031104093905.GF24152@st> Mime-Version: 1.0 (Apple Message framework v606) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <65B5AFEA-0EFE-11D8-9AA8-000393CFE6B8@spy.net> Content-Transfer-Encoding: 7bit Cc: Caml Mailing List From: Dustin Sallings Subject: Re: [Caml-list] Map efficiency? Date: Tue, 4 Nov 2003 11:37:59 -0800 To: Christian Lindig X-Mailer: Apple Mail (2.606) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 lindig:01 beginners:01 generic:01 map's:01 implemented:01 functor:01 functorial:01 int:01 terribly:01 nov:01 syntax:02 user-defined:02 user-defined:02 module:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Nov 4, 2003, at 1:39, Christian Lindig wrote: >> Also, is there a particular reason Map is so, um, inaccessible to >> beginners? Hashtbl's generic interface is much more inviting than >> Map's functorial-only interface, especially to those not terribly >> familiar with the module system. > > Map depends on keys to be ordered. This in turn requires to allow for a > user-defined order: assume sets as keys that are implemented by > unordered lists. Different lists can represent the same set. Hence, it > must be possible to provide a user-defined order that would treat those > lists as equal. The functor argument of Map contains the compare() > which > does just that. I'm not suggesting doing away with the functorial interface, just providing an additional one that is more accessible. I mean, something like this would be cool (excuse my abuse of syntax): Map.create ('a -> 'a -> int) Then my app would just do this: Map.create compare;; -- Dustin Sallings ------------------- 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