English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Module equivalence across definitions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-10-16 (21:14)
From: Lauri Alanko <la@i...>
Subject: [Caml-list] Module equivalence across definitions
[Pardon for possible duplicates]

Hello. Given:

module type T = sig
  type t

module A : T = struct
  type t = A

module B(X:T) = struct
  type t = B
  let v = B

module type CT = sig
  val a : B(A).t

module C : CT = struct
  module Aalias = A
  module BA = B(Aalias)
  let a = BA.v

I get an error:

Signature mismatch:
Modules do not match:
    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
is not included in
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

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
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