From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA00370; Tue, 16 Oct 2001 23:14:32 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA00317 for caml-list@pauillac.inria.fr; Tue, 16 Oct 2001 23:14:31 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA10444 for ; Sat, 13 Oct 2001 20:07:37 +0200 (MET DST) Received: from no-spam.it.helsinki.fi (NO-SPAM.it.helsinki.fi [128.214.205.34]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f9DI7aj22737 for ; Sat, 13 Oct 2001 20:07:36 +0200 (MET DST) Received: from la.pp.htv.fi (root@sirppi.helsinki.fi [128.214.205.27]) by no-spam.it.helsinki.fi (8.11.4/8.11.4-SPAMmers-sod-off) with ESMTP id f9DI7YV28608 for ; Sat, 13 Oct 2001 21:07:35 +0300 (EEST) Received: from la by la.pp.htv.fi with local (Exim 3.32 #1 (Debian)) id 15sTCB-0000bj-00 for ; Sat, 13 Oct 2001 21:07:35 +0300 Date: Sat, 13 Oct 2001 21:07:33 +0300 From: Lauri Alanko To: caml-list@pauillac.inria.fr Subject: [Caml-list] Module equivalence across definitions Message-ID: <20011013210733.G412@la.iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.22i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk [Pardon for possible duplicates] Hello. Given: module type T = sig type t end module A : T = struct type t = A end module B(X:T) = struct type t = B let v = B end module type CT = sig val a : B(A).t end module C : CT = struct module Aalias = A module BA = B(Aalias) let a = BA.v end I get an error: Signature mismatch: Modules do not match: sig module Aalias : sig type t = A.t end module BA : sig type t = B(Aalias).t = B val v : t end val a : BA.t end is not included in CT Values do not match: val a : BA.t is not included in val a : B(A).t But changing "module BA = B(Aalias)" to "module BA = B(A)" makes everything work. What gives? I'm used to seeing structural equivalence being used everywhere in O'Caml's type system, but here simply renaming a module seems to give it a distinct new identity. Is this a bug or a feature? Lauri Alanko la@iki.fi ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr