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=HTML_MESSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id BA38ABC37 for ; Thu, 14 May 2009 16:42:43 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AksEANTKC0qLEwExbmdsb2JhbACCJC+UTD+pOY9/BIQC X-IronPort-AV: E=Sophos;i="4.38,431,1233529200"; d="scan'208,217";a="29317929" Received: from hera.mpi-sb.mpg.de ([139.19.1.49]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 14 May 2009 16:42:43 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mpi-sb.mpg.de; s=mail200803; h=Message-Id:From:To:In-Reply-To: Content-Type:Subject:Mime-Version:Date:References; bh=zN68zlBrvo 4JcUOi6jBuFp44d7hcqAF5freps+ly5uY=; b=CXc3/x9pQSYikQSG4TW2xyMwpN 2IypzfmjvCnP+NNuw3dxpZEWGPy4UQREk1hPy/cDlpLm8jLPLiliLxbyEwNJ7MJl anurEA8GJlh5/PtowRD13/tqOLw3NKv9dsBabo29KPweDJZBYXUx4b2m50qWpGMZ hHaAKAuqCapfuq2xk= Received: from newzak.mpi-sb.mpg.de ([139.19.1.28]:58339) by hera.mpi-sb.mpg.de (envelope-from ) with esmtp (Exim 4.69) id 1M4c8t-0004gz-FK; Thu, 14 May 2009 16:42:42 +0200 Received: from g226214195.adsl.alicedsl.de ([92.226.214.195]:52636 helo=[192.168.2.14]) by newzak.mpi-sb.mpg.de with esmtpsa (TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63) (envelope-from ) id 1M4c8t-0006lO-12; Thu, 14 May 2009 16:42:39 +0200 Message-Id: <4955C3A2-8E43-460E-BEB6-44141E300098@mpi-sws.org> From: Andreas Rossberg To: caml-list@yquem.inria.fr In-Reply-To: <4A0BCF0D.6060207@inescporto.pt> Content-Type: multipart/alternative; boundary=Apple-Mail-23--135530425 Subject: Re: [Caml-list] Shared types: dependency in modules with polymorphic type Mime-Version: 1.0 (Apple Message framework v930.3) Date: Thu, 14 May 2009 16:42:38 +0200 References: <4A0B1B81.8090700@inescporto.pt> <4A0B2218.2050305@mcmaster.ca> <4A0BCF0D.6060207@inescporto.pt> X-Mailer: Apple Mail (2.930.3) X-Spam: no; 0.00; rossberg:01 rossberg:01 annotations:01 fwiw:01 functor:01 annotations:01 fwiw:01 functor:01 polymorphic:01 wrote:01 wrote:01 andreas:01 andreas:01 caml-list:01 dependency:01 --Apple-Mail-23--135530425 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On May 14, 2009, at 09.58 h, Hugo Ferreira wrote: > >>> 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. > > Worked correctly. However I need only remove the U in Make_U : U and > change it to a simple Make_U. "U1.t" now becomes visible and binds > correctly. FWIW, the "proper" solution is not to drop the annotation, but to refine it to "U with type t = int Vb.t" in the definition of the functor. - Andreas --Apple-Mail-23--135530425 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable
On May 14, 2009, at = 09.58 h, Hugo Ferreira wrote:

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 =3D U1.t =3D = 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.

Worked correctly. However I need only remove = the U in Make_U : U and
change it to a simple Make_U. "U1.t" now = becomes visible and = binds
correctly.

FWIW, the = "proper" solution is not to drop the annotation, but to refine it to "U = with type t =3D int Vb.t" in the definition of the = functor.

- = Andreas

= --Apple-Mail-23--135530425--