Module Markup.Scope

Scoping rules

In this floating comment I can refer to type t and value v declared later in the signature

type t
val v : t
val x : int
val y : int
module A : sig ... end

In this module I can refer to val x declared above as well as type u declared later in the parent module. Elements declared in this signature take priority, so y refers to A.y as opposed to the y declared in the parent signature.

type u