Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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.