From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id LAA11846 for caml-redistribution; Tue, 5 Mar 1996 11:36:21 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.6.10/8.6.6) with ESMTP id KAA10138 for ; Tue, 5 Mar 1996 10:05:48 +0100 Received: from cherub.hd.ibm.de (cherub.hd.ibm.de [192.101.197.10]) by concorde.inria.fr (8.7.1/8.7.1) with SMTP id KAA15103 for ; Tue, 5 Mar 1996 10:04:28 +0100 (MET) Received: from kaa.heidelbg.ibm.com by cherub.hd.ibm.de (AIX 3.2/UCB 5.64/4.03/chkV1.0) id AA66138; Tue, 5 Mar 1996 10:04:02 +0100 Received: from idse.heidelbg.ibm.com by kaa.heidelbg.ibm.com (AIX 3.2/UCB 5.64/4.03) id AA31350; Tue, 5 Mar 1996 10:03:35 +0100 Received: by idse.heidelbg.ibm.com (AIX 3.2/UCB 5.64/4.03) id AA36425; Tue, 5 Mar 1996 10:03:34 +0100 Message-Id: <9603050903.AA36425@idse.heidelbg.ibm.com> To: Xavier Leroy Cc: Guy.Cousineau@ens.fr, caml-list@pauillac.inria.fr Subject: Re: CSL modules In-Reply-To: (Your message of Mon, 04 Mar 96 15:05:49 N.) <199603041405.PAA26261@pauillac.inria.fr> Date: Tue, 05 Mar 96 10:03:33 +0100 From: Wolfgang Lux Sender: weis > This is easily done using a signature constraint to specify exactly > how much of C should remain visible: > > module type SIGA = > sig > type ta = A | B of int > val xa : ta > end > module type SIGB = > sig > type tb = C | D of string > val xb : tb > end > [ alternate (and better) definition of SIGC and F deleted] > module type SIGC = > sig > type ta = A.ta (* concrete *) > type tb (* abstract *) > val xa : ta > val xb : tb > end > module F(A: SIGA)(B: SIGB) = > (struct > type ta = A.ta > type tb = B.tb > let xa = A.xa > let xb = B.xb > end : SIGC) > module C = F(A)(B) > Being curious I tried this and got an error from CSL 1.14, which I really don't understand. After defining SIGA and SIGB and the following two sample modules module A : SIGA = struct type ta = A | B of int let xa = B 4 end module B : SIGB = struct type tb = C | D of string let xb = D "hello" end I can define SIGC, but when I enter the definition of F, CSL returns the following error: Signature mismatch: Modules do not match: sig type ta = A.ta type tb = B.tb val xa : A.ta val xb : B.tb end is not included in SIGC Type declarations do not match: type ta = A.ta is not included in type ta = A.ta Any clues? Wolfgang ---- Wolfgang Lux WZH Heidelberg, IBM Germany Internet: lux@heidelbg.ibm.com +49-6221-59-4546 VNET: LUX at HEIDELBG +49-6221-59-3500 (fax) EARN: LUX at DHDIBMIP