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 DAA28511; Wed, 22 Aug 2001 03:54:31 +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 DAA28484 for ; Wed, 22 Aug 2001 03:54:30 +0200 (MET DST) Received: from localhost.localdomain (ppp87.dyn147.pacific.net.au [210.23.147.87]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f7M1sRj26312 for ; Wed, 22 Aug 2001 03:54:28 +0200 (MET DST) Received: from maxtal.com.au (IDENT:root@localhost [127.0.0.1]) by localhost.localdomain (8.9.3/8.8.7) with ESMTP id LAA14699; Wed, 22 Aug 2001 11:54:16 +1000 Message-ID: <3B8310C8.4B09F8E1@maxtal.com.au> Date: Wed, 22 Aug 2001 11:54:16 +1000 From: John Max Skaller X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: Francis Dupont CC: caml-list@inria.fr Subject: Re: [Caml-list] real lazy? References: <200108211337.f7LDbGl36930@givry.rennes.enst-bretagne.fr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Francis Dupont wrote: > > I've got Chris Okasaki's "Purely Functional Data Structures" > (a very nice book). Of course, I've tried to program the examples > (I needed some training with functors :-) and I've found some > issues: > - no recursion in modules (1) but I don't complain because > this cannot (should not!) be done It can be done with suitable constraints. Intermodule function calling is no problem in Felix! Nor is intermodule type dependence, provided the types aren't mutually recursive, and even that works provided there is an 'object boundary' in the way such a union of variants. In fact, ALL definitions in Felix at the same scope are mutually recursive. You have to work hard to get a linear ordering! [Getting 'open' to work at the same scope as the module it opens was some fun!] > PS: more: > > 1- recursion in modules: > module A = struct type t = C of B.tt ... end > module B = Make(A) > where Make is a functor. A uses B which is built from A. Agree: the Felix equivalent won't work either. But it tries, and reports an error: not all intermodule recursions are unsound (not all sound ones are admitted, but some of them are, including function calling). Interestingly: Felix applies functors in a trivial way that permits recursion into functor instances where the corresponding intermodule recursion is also allowed: the functor instance is constructed 'on demand' rather than wholistically. What is not permitted is an interface recursion, since matching interfaces to modules is done wholistically (even when the interface/module component pair isn't used). -- John (Max) Skaller, mailto:skaller@maxtal.com.au 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850 New generation programming language Felix http://felix.sourceforge.net Literate Programming tool Interscript http://Interscript.sourceforge.net ------------------- 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