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
question about "with module"
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-03-22 (16:12)
From: Stephen Weeks <sweeks@s...>
Subject: question about "with module"
Why does this program typecheck?

module type S = sig
  module A : sig
    val x : int
  module Z : sig
    module B : sig
  end with module B = A

module F (S : S) = struct let _ = S.Z.B.x end

The explanation of "with module" in the manual:



  The constraint module module-path = extended-module-path adds type equations
  to all type components of the sub-structure denoted by module-path, making
  them equivalent to the corresponding type components of the structure denoted
  by extended-module-path.

It doesn't say anything about adding value components.