package odoc

  1. Overview
  2. Docs
On This Page
  1. Scoping rules
Legend:
Library
Module
Module type
Parameter
Class
Class type

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
OCaml

Innovation. Community. Security.