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 LAA30767; Fri, 13 Jul 2001 11:35:01 +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 LAA30766 for ; Fri, 13 Jul 2001 11:35:00 +0200 (MET DST) Received: from chopin.ai.univie.ac.at (chopin.ai.univie.ac.at [131.130.174.170]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f6D9Yvb04408 for ; Fri, 13 Jul 2001 11:34:58 +0200 (MET DST) Received: (from markus@localhost) by chopin.ai.univie.ac.at (8.9.3/8.9.3/Debian 8.9.3-21) id LAA00492; Fri, 13 Jul 2001 11:34:47 +0200 Date: Fri, 13 Jul 2001 11:34:46 +0200 From: Markus Mottl To: "Krishnaswami, Neel" Cc: caml-list@inria.fr Subject: Re: [Caml-list] A G'Caml question" + additional info Message-ID: <20010713113446.A412@chopin.ai.univie.ac.at> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from neelk@cswcasa.com on Thu, Jul 12, 2001 at 17:30:00 -0400 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 12 Jul 2001, Krishnaswami, Neel wrote: > If desired, I can offer a red-black tree implementation that implements > the whole Map and Set interfaces. (I wonder how many other people have > been inspired by that Okasaki paper?) Having tried RedBlackSet as presented in Okasaki's book a while ago, I was rather disappointed. It didn't perform faster (rather slower) than the Set-module (balanced binary trees) on some quick examples that I had tried. But maybe my simple tests were not representative. > > Note that the non-polymorphic version also has advantages for > > users: e.g. they don't have to pass around comparison functions > > all the time. > > ??? I don't understand this. In both the object version I posted > and the functorial version that Brian Rogoff posted, a hacker > only needs to mention the comparison function when creating the > type, and then never again when making or using trees. In the functorial version you naturally have to use a functor application. I meant a polymorphic implementation without functors, since I think you had complained somewhere about having to apply functors. This was probably not obvious from my text. > In fact, my first experiment along these lines was to use a record > with a tree and a comparison function in it. But even there, one > could use currying to mention the function comparison only once. > (I rejected it because it permitted trees with different but type- > compatible comparison functions to intermix.) But you have to manually curry every Set-function you want to use at least once. The functor application creates the closures for the whole Set-module at once. Regards, Markus Mottl -- Markus Mottl markus@oefai.at Austrian Research Institute for Artificial Intelligence http://www.oefai.at/~markus ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr