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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 55E93BC0A for ; Mon, 19 Feb 2007 00:18:57 +0100 (CET) Received: from coriana6.cis.mcmaster.ca (coriana6.CIS.McMaster.CA [130.113.128.17]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l1INIuPF011374 for ; Mon, 19 Feb 2007 00:18:56 +0100 Received: from Dura7.UTS.McMaster.CA (dura7.UTS.mcmaster.ca [130.113.196.62]) by coriana6.cis.mcmaster.ca (8.13.7/8.13.7) with ESMTP id l1INImI3028195 for ; Sun, 18 Feb 2007 18:18:55 -0500 (EST) Received: from cgpsrv2.cis.mcmaster.ca (univmail.CIS.McMaster.CA [130.113.64.46]) by Dura7.UTS.McMaster.CA (8.13.7/8.13.7) with ESMTP id l1INIGeQ017761 for ; Sun, 18 Feb 2007 18:18:16 -0500 Received: from [74.109.166.109] (account carette@univmail.cis.mcmaster.ca HELO [192.168.1.101]) by cgpsrv2.cis.mcmaster.ca (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 162756022 for caml-list@inria.fr; Sun, 18 Feb 2007 18:18:16 -0500 Message-ID: <45D8DEB7.3030004@mcmaster.ca> Date: Sun, 18 Feb 2007 18:18:15 -0500 From: Jacques Carette Organization: McMaster University User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: OCaml Subject: Rank-2 polymorphism woes in module signatures Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version-Mac: 4.7.1.128075, Antispam-Engine: 2.4.0.264935, Antispam-Data: 2007.2.18.144933 X-PerlMx-Spam: Gauge=IIIIIII, Probability=7%, Report='__CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' X-Miltered: at concorde with ID 45D8DEE0.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; polymorphism:01 sig:01 struct:01 struct:01 mismatch:01 'sv:98 'sv:98 signatures:01 modules:02 match:02 match:02 mcmaster:02 module:03 module:03 jacques:03 [Simplified problem]: module type Symantics = sig type ('c,'sv,'dv) repr type ('c, 'sv, 'dv) pack = { _lam : 'sa 'sb 'da 'db . (('c,'sa,'da) repr -> ('c,'sb,'db) repr) -> ('c,(('c,'sa,'da) repr -> ('c,'sb,'db) repr),'da->'db) repr; } end (* concrete *) module R = struct type ('c,'sv,'dv) repr = 'dv type ('c, 'sv, 'dv) pack = { _lam : 'sa 'sb 'da 'db . (('c,'sa,'da) repr -> ('c,'sb,'db) repr) -> ('c,(('c,'sa,'da) repr -> ('c,'sb,'db) repr),'da->'db) repr; } end;; module XX(S:Symantics) = struct end;; module XXR = XX(R);; and I get Signature mismatch: Modules do not match: [...] is not included in Symantics Type declarations do not match: type ('a, 'b, 'c) pack = ('a, 'b, 'c) R.pack = { _lam : 'd 'e 'f 'g. (('a, 'd, 'f) repr -> ('a, 'e, 'g) repr) -> ('a, ('a, 'd, 'f) repr -> ('a, 'e, 'g) repr, 'f -> 'g) repr; } is not included in type ('a, 'b, 'c) pack = { _lam : 'd 'e 'f 'g. (('a, 'd, 'f) repr -> ('a, 'e, 'g) repr) -> ('a, ('a, 'd, 'f) repr -> ('a, 'e, 'g) repr, 'f -> 'g) repr; } Those look absolutely identical to me - especially since the definitions were done via copy & paste. The rank-1 parts of the same record work fine [not shown], but none of the rank-2 parts do. The above is a minimal extraction from a real program. Can anyone help? [This is in 3.09.01] Jacques