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 QAA12241 for caml-red; Thu, 3 Aug 2000 16:20:29 +0200 (MET DST) 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 PAA13747 for ; Thu, 3 Aug 2000 15:55:21 +0200 (MET DST) Received: from miss.wu-wien.ac.at (miss.wu-wien.ac.at [137.208.107.17]) by nez-perce.inria.fr (8.10.0/8.10.0) with ESMTP id e73DtKH28507 for ; Thu, 3 Aug 2000 15:55:20 +0200 (MET DST) Received: (from mottl@localhost) by miss.wu-wien.ac.at (8.9.0/8.9.0) id PAA24096; Thu, 3 Aug 2000 15:55:18 +0200 (MET DST) Date: Thu, 3 Aug 2000 15:55:18 +0200 From: Markus Mottl To: Michael Welsh Duggan Cc: caml-list@inria.fr Subject: Re: Recursive Sets? Message-ID: <20000803155518.A18931@miss.wu-wien.ac.at> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: ; from md5i@cs.cmu.edu on Wed, Aug 02, 2000 at 14:34:59 -0400 Sender: weis@pauillac.inria.fr On Wed, 02 Aug 2000, Michael Welsh Duggan wrote: > I have been trying to create a recursive type which can express sets > of itself. The following code is not meant to be correct (it isn't), > but hopefully expresses the sort of thing I want to do. Can someone > throw some ideas at me? I am afraid, but it is not possible to have mutually recursive module and type definitions. See the following entry in the archive: http://pauillac.inria.fr/bin/wilma_hiliter/caml-list/199901/msg00016.html?line=47#hilite I don't know what exactly you want to do. Some time ago I implemented a referentially transparent directory service that might be similar to what you want to implement, e.g.: +-root-+ / | | \ a b \ c | / f d e /|\ g h i It is possible to update nodes directly without losing persistence. E.g.: let dir1 = (* directory as above, the "current working directory" is "root" *) in let dir2 = Dir.cd_path dir1 ["f"; "h"; "x"] ... This will keep "dir1" unchanged, but "dir2" will look as follows (the CWD will be "root/f/h/x"): +-root-+ / | | \ a b \ c | / f d e /|\ g h i | x You can parameterize the directory over arbitrary ordered elements. If it is something like this you need, I could place it online (though, it is part of a larger project that I'll release in a few weeks, anyway - not much time right now)... Regards, Markus Mottl -- Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl