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=1.4 required=5.0 tests=DNS_FROM_RFC_POST autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 049ABBC69 for ; Sun, 23 Dec 2007 15:25:32 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAMb+bUfUKEUHfGdsb2JhbACBV44zAQEJCimYWA X-IronPort-AV: E=Sophos;i="4.24,201,1196636400"; d="scan'208";a="5479096" Received: from mail.dravanet.hu (HELO arwen.dravanet.hu) ([212.40.69.7]) by mail2-smtp-roc.national.inria.fr with ESMTP; 23 Dec 2007 15:25:31 +0100 Received: from arwen-vbmailshield (localhost.localdomain [127.0.0.1]) by arwen-vbmailshield (Postfix) with SMTP id B704D15E4 for ; Sun, 23 Dec 2007 15:25:14 +0100 (CET) Received: from arwen.dravanet.hu ([127.0.0.1]) by arwen ([192.168.69.23]) with SMTP (gateway) id A02EFA48BB0; Sun, 23 Dec 2007 15:24:59 +0100 Received: from [127.0.0.1] (unknown [212.40.85.9]) by arwen.dravanet.hu (Postfix) with ESMTP id F24D71353 for ; Sun, 23 Dec 2007 15:24:56 +0100 (CET) Message-ID: <476E6FB7.6040100@dravanet.hu> Date: Sun, 23 Dec 2007 15:24:55 +0100 From: =?ISO-8859-1?Q?=22M=E1rk_S=2E_Zolt=E1n=22?= User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Type visibility limitation in recursive modules Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 071215-0, 12/15/2007), Outbound message X-Antivirus-Status: Clean X-VBMailShield: version 1.57.6 at arwen - template: default X-Spam: no; 0.00; recursive:01 sig:01 struct:01 sig:01 val:01 struct:01 compiler:01 compiler:01 behold:98 rec:01 complains:01 opaque:01 modules:02 module:03 let:03 Behold the following code snippet: module rec Aleph : sig type t = Tag of Beth.t end = struct type t = Tag of Beth.t end and Beth : sig type t val scandalous : Aleph.t end = struct type t = Aleph.t list let scandalous = Aleph.Tag((* HERE BE DRAGONS *) []) end The compiler complains that the empty list after HERE BE DRAGONS has type 'a list but it is used with type Beth.t. I'd expect the compiler to discover that those types can be unified via 'a == Aleph.t, since as far as I can tell, all necessary facts are visible at that point. Replacing "Beth : sig type t ..." with "Beth : sig type t = Aleph.t list ..." does away with the error, but I would very much like to keep Beth.t an opaque type. Is this an intended behavior? And if it is intended, is there a way to tell the compiler what I really want it to do? Thanks in advance for any help. Z-