From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA21272 for caml-red; Sat, 10 Feb 2001 20:24:49 +0100 (MET) 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 RAA14382 for ; Fri, 9 Feb 2001 17:47:19 +0100 (MET) Received: from shell5.ba.best.com (shell5.ba.best.com [206.184.139.136]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f19GlIL29897 for ; Fri, 9 Feb 2001 17:47:18 +0100 (MET) Received: from localhost (bpr@localhost) by shell5.ba.best.com (8.9.3/8.9.2/best.sh) with ESMTP id IAA29594; Fri, 9 Feb 2001 08:47:17 -0800 (PST) Date: Fri, 9 Feb 2001 08:47:17 -0800 (PST) From: Brian Rogoff To: Claudio Russo cc: caml-list@inria.fr Subject: RE: first class, recursive, mixin modules (was: RE: first class m odules) In-Reply-To: <112C6E8A1B25D34BB27D48D2FD2E96CFC942C0@TVP-MSG-02.europe.corp.microsoft.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: weis@pauillac.inria.fr On Fri, 9 Feb 2001, Claudio Russo wrote: > > Cool! OK, now Alain has at least one example of a practically > > useful case > > handled by your scheme :-). I suspect that this problem bites > > lots of ML > > programmers, and a fix is eagerly desired by at least two OCaml > > programmers. Congratulations on making this work, the millenium is > > starting off on a great note already! > > I'm not really sure it bites that many, but I'd like to be told > otherwise. I'd be very surprised if it hasn't bitten a very large fraction of people who've used ML seriously for any length of time. I actually presented a sort of "solution" in Mosml using recursive modules but the problem is that of wanting a recursion between a type declaration and a functor instantiation. I've actually noticed quite a few mails from programmers on this topic. > It does really hit you when trying to implement Chris Okasakis elegant > bootstrapped data structures, or emulate object oriented things with > modules. It's close to something OO, the "Composite" pattern, but it is not a particularly OO concept. Many hierarchical structures have a leaf/hier relationship and as soon as you try to reuse the Set functor or a signature in the type definition of the composite you get slapped. In the faux-ML code I wrote, you could switch representations of the collection with a single line change. It is a bit verbose, but I prefer it to the parameterization trick, which requires that I change the library to get additional polymorphism. -- Brian