From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id A2E6DBC37 for ; Wed, 13 May 2009 21:41:00 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApYBAGa/CkqCcYARmWdsb2JhbACXFwEBAQEBCAsKBxG4M4QCBQ X-IronPort-AV: E=Sophos;i="4.41,189,1241388000"; d="scan'208";a="39921926" Received: from coriana6.cis.mcmaster.ca ([130.113.128.17]) by mail4-smtp-sop.national.inria.fr with ESMTP; 13 May 2009 21:40:59 +0200 Received: from Gorash7.UTS.McMaster.CA (Gorash7.UTS.mcmaster.ca [130.113.196.61]) by coriana6.cis.mcmaster.ca (8.13.7/8.13.7) with ESMTP id n4DJePVe023030; Wed, 13 May 2009 15:40:49 -0400 (EDT) Received: from cgpsrv2.cis.mcmaster.ca (univmail.CIS.McMaster.CA [130.113.64.46]) by Gorash7.UTS.McMaster.CA (8.13.7/8.13.7) with ESMTP id n4DJe8hI024856; Wed, 13 May 2009 15:40:08 -0400 Received: from [99.235.230.129] (account carette@univmail.cis.mcmaster.ca HELO [192.168.1.101]) by cgpsrv2.cis.mcmaster.ca (CommuniGate Pro SMTP 5.2.12) with ESMTPSA id 253968010; Wed, 13 May 2009 15:40:08 -0400 Message-ID: <4A0B2218.2050305@mcmaster.ca> Date: Wed, 13 May 2009 15:40:08 -0400 From: Jacques Carette Organization: McMaster University User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: Hugo Ferreira Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Shared types: dependency in modules with polymorphic type References: <4A0B1B81.8090700@inescporto.pt> In-Reply-To: <4A0B1B81.8090700@inescporto.pt> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version-Mac: 5.4.2.338381, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2009.5.13.193148 X-PerlMx-Spam: Gauge=IIIIIII, Probability=7%, Report='BODY_SIZE_1200_1299 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __BOUNCE_CHALLENGE_SUBJ 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __SANE_MSGID 0, __USER_AGENT 0' X-Spam: no; 0.00; struct:01 unification:01 annotations:01 polymorphic:01 wrote:01 abstract:01 caml-list:01 dependency:01 constraint:01 modules:02 modules:02 declaration:02 mcmaster:02 checking:02 constraints:03 One modification which will get you a long way towards your goal is to remove the : VB from Hugo Ferreira wrote: > module VB1 : VB > = struct ... While this may look like it is just "type checking", it in fact does more and makes sure that VB1.t, to the outside world, is abstract. This stops any possibility of unification with 'like' types. Same with Make_U. Note that VB1 will still be of type VB, and you can be sure of that because the constraint in Make_U's signature will enforce it -- only a bit later than at declaration time, at use-time. > My question is: is their any way I may organize the modules or > indicate shared types in order to use a (very extensive) VB > interface (Or VB1 module)? Specifically how do I enforce the > shared type: > > U1.instance VB1.t = U1.t = Make_U(VB1).t First, try the above. It may help. If it does not, then you will need to add explicit sharing constraints. But which sharing constraints are *really* needed will be the ones revealed by first removing the type annotations you currently have. Note that you should not have to re-organize your modules at all to achieve this [at least, not in this example]. Jacques