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 1AB7DBB84 for ; Fri, 1 Aug 2008 13:11:16 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AscAAKqLkkiK6AGOmmdsb2JhbACLIIcGAQEBAQEIBQgHEZ5g X-IronPort-AV: E=Sophos;i="4.31,293,1215381600"; d="scan'208";a="27877989" Received: from lmr1.uibk.ac.at (HELO smtp.uibk.ac.at) ([138.232.1.142]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 01 Aug 2008 13:11:15 +0200 Received: from [138.232.66.221] (pc6221-c703.uibk.ac.at [138.232.66.221] christian.sternagel@uibk.ac.at) (authenticated bits=0) by smtp.uibk.ac.at (8.13.8/8.13.8/F1) with ESMTP id m71BBCOR002936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 1 Aug 2008 13:11:12 +0200 Message-ID: <4892EF0C.5090505@uibk.ac.at> Date: Fri, 01 Aug 2008 13:10:04 +0200 From: Christian Sternagel User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Problem with Functors and Module Types Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.61 at uibk.ac.at on 138.232.1.140 X-Spam: no; 0.00; functors:01 functors:01 sig:01 val:01 sig:01 val:01 struct:01 struct:01 compiler:01 compiler:01 cheers:01 maken:98 maken:98 compiles:01 int:01 Hello, once again I have some problems using functors with module types. I produced following (almost?) minimal example: module type MT_M = sig type s type t = A of s | B of t list val f : t -> t end module type MT_N = sig module M : MT_M val f : 'a -> M.t end module type MT_A = sig type t end module MakeM (A : MT_A) : MT_M with type s = A.t = struct type s = A.t type t = A of s | B of t list let f x = x end module MakeN (A : MT_A) (* : MT_N *) = struct module M = MakeM (A) let f _ = M.B [] end module A = struct type t = int end module M = MakeM (A) module N = MakeN (A) let _ = (M.f (N.f 1)) This file compiles, but when I comment-in the module type restriction for `MakeN' the error This expression has type N.M.t = MakeN(A).M.t but is here used with type M.t = MakeM(A).t occurs. I understand that in the current setting the two types are not equal for the compiler. However, my question is: Is there a way to tell the compiler that the two types should be equal? cheers christian