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 KAA15043; Wed, 24 Mar 2004 10:14:44 +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 KAA15182 for ; Wed, 24 Mar 2004 10:14:42 +0100 (MET) Received: from newext.lri.fr (ext.lri.fr [129.175.15.4]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i2O9FHKW030302 for ; Wed, 24 Mar 2004 10:15:18 +0100 Received: from serveur-mail.lri.fr (serveur-mail [129.175.8.90]) by newext.lri.fr (8.12.10/jtpda-5.4) with ESMTP id i2O8if8U026317 ; Wed, 24 Mar 2004 09:44:41 +0100 (MET) Received: from pc8-119.lri.fr (pc8-119 [129.175.8.119]) by serveur-mail.lri.fr (8.11.6p2/jtpda-5.3.2) with ESMTP id i2O8ifq12526 ; Wed, 24 Mar 2004 09:44:41 +0100 (MET) Received: from localhost ([127.0.0.1]) by pc8-119.lri.fr with esmtp (Exim 3.36 #1 (Debian)) id 1B6408-0007Qf-00; Wed, 24 Mar 2004 09:44:41 +0100 Date: Wed, 24 Mar 2004 09:44:40 +0100 (MET) From: Julien Signoles To: Jacques Garrigue cc: skaller@users.sourceforge.net, Subject: Re: [Caml-list] extensible records again In-Reply-To: <20040324104118K.garrigue@kurims.kyoto-u.ac.jp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; signoles:01 signoles:01 lri:01 caml-list:01 extensible:01 struct:01 struct:01 lri:01 mcvoy:01 sig:01 sig:01 rec:01 rec:01 encoded:02 module:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 345 > > type x = [`A of +x | `B ] > > type y = [x | `C ] > > might be encoded as > > module type Xrec = sig type t end > module X0(Xrec : Xrec) = > struct type t0 = Xrec.t type t = [`A of t0 | `B] end > module type Xsig = sig type t0 type t = [`A of t0 | `B] end > module rec X : (Xsig with type t0 = X.t) = X0(X) > module Y0(Xrec : Xrec) = > struct > module XY = X0(Xrec) > type t0 = Xrec.t > type t = [XY.t | `C] > end > module type Ysig = ??? > module rec Y : (Xsig with type t0 = Y.t) = Y0(Y) (* [...] *) module type Ysig = sig module XY : Xsig type t0 type t = [ XY.t | `C] end module rec Y : (Ysig with module XY = X0(Y) and type t0 = Y.t) = Y0(Y) What do you think about this signature ? But perhaps I misunderstand somethink: I think you don't use t0 in Y0 and Ysig because t0 is enclosed in XY. I would write somethink like: (* [...] *) module Y0(Xrec : Xrec) = struct module XY = X0(Xrec) type t = [XY.t | `C] end module type Ysig = sig module XY : Xsig type t = [ XY.t | `C] end module rec Y : (Ysig with module XY = X0(Y)) = Y0(Y) Julien -- mailto:Julien.Signoles@lri.fr ; http://www.lri.fr/~signoles "In theory, practice and theory are the same, but in practice they are different" (Larry McVoy) ------------------- 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