Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* question about "with module"
@ 2007-03-22 16:12 Stephen Weeks
  0 siblings, 0 replies; only message in thread
From: Stephen Weeks @ 2007-03-22 16:12 UTC (permalink / raw)
  To: caml-list

Why does this program typecheck?

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

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

The explanation of "with module" in the manual:

  http://caml.inria.fr/pub/docs/manual-ocaml/manual018.html

says:

  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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-03-22 16:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-22 16:12 question about "with module" Stephen Weeks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox