Up

module DocOckPaths

: sig

Paths of documentation

Kinds

#
module Kind : sig

General purpose kinds

#
type any = [
| `Module
| `ModuleType
| `Type
| `Constructor
| `Field
| `Extension
| `Exception
| `Value
| `Class
| `ClassType
| `Method
| `InstanceVariable
| `Label
]

Any possible referent

#
type signature = [
| `Module
| `ModuleType
]

A referent that can contain signature items

#
type class_signature = [
| `Class
| `ClassType
]

A referent that can contain class signature items

#
type datatype = [
| `Type
]

A referent that can contain datatype items

#
type parent = [ ]

A referent that can contain other items

Identifier kinds

The kind of an identifier directly corresponds to the kind of its referent.

#
type identifier = any
#
type identifier_module = [
| `Module
]
#
type identifier_module_type = [
| `ModuleType
]
#
type identifier_type = [
| `Type
]
#
type identifier_constructor = [
| `Constructor
]
#
type identifier_field = [
| `Field
]
#
type identifier_extension = [
| `Extension
]
#
type identifier_exception = [
| `Exception
]
#
type identifier_value = [
| `Value
]
#
type identifier_class = [
| `Class
]
#
type identifier_class_type = [
| `ClassType
]
#
type identifier_method = [
| `Method
]
#
type identifier_instance_variable = [
| `InstanceVariable
]
#
type identifier_label = [
| `Label
]

Path kinds

There are four kinds of OCaml path:

  • module
  • module type
  • type
  • class type

These kinds do not directly correspond to the kind of their referent (e.g. a type path may refer to a class definition).

#
type path = [
| `Module
| `ModuleType
| `Type
| `Class
| `ClassType
]
#
type path_module = [
| `Module
]
#
type path_module_type = [
| `ModuleType
]
#
type path_type = [
| `Type
| `Class
| `ClassType
]
#
type path_class_type = [
| `Class
| `ClassType
]

Fragment kinds

There are two kinds of OCaml path fragment:

  • module
  • type

These kinds do not directly correspond to the kind of their referent (e.g. a type path fragment may refer to a class definition).

#
type fragment = [
| `Module
| `Type
| `Class
| `ClassType
]
#
type fragment_module = [
| `Module
]
#
type fragment_type = [
| `Type
| `Class
| `ClassType
]

Reference kinds

There is one reference kind for each kind of referent. However, the kind of a reference does not refer to the kind of its referent, but to the kind with which the reference was annotated.

This means that reference kinds do not correspond directly to the kind of their referent because we used more relaxed rules when resolving a reference. For example, a reference annotated as being to a constructor can be resolved to the definition of an exception (which can be thought of a sort of constructor).

#
type reference = any
#
type reference_module = [
| `Module
]
#
type reference_module_type = [
| `ModuleType
]
#
type reference_type = [
| `Type
| `Class
| `ClassType
]
#
type reference_constructor = [
| `Constructor
| `Extension
| `Exception
]
#
type reference_field = [
| `Field
]
#
type reference_extension = [
| `Extension
| `Exception
]
#
type reference_exception = [
| `Exception
]
#
type reference_value = [
| `Value
]
#
type reference_class = [
| `Class
]
#
type reference_class_type = [
| `Class
| `ClassType
]
#
type reference_method = [
| `Method
]
#
type reference_instance_variable = [
| `InstanceVariable
]
#
type reference_label = [
| `Label
]
end

Identifiers

*

#
module Identifier : sig

Identifiers for definitions

#
type kind = Kind.identifier
#
type ('a, 'b) t =
# | Root : 'a * string -> ('a, [< > `Module ]) t
# | Module : 'a signature * string -> ('a, [< > `Module ]) t
# | Argument : 'a signature * int * string -> ('a, [< > `Module ]) t
# | ModuleType : 'a signature * string -> ('a, [< > `ModuleType ]) t
# | Type : 'a signature * string -> ('a, [< > `Type ]) t
# | CoreType : string -> ('a, [< > `Type ]) t
# | Constructor : 'a datatype * string -> ('a, [< > `Constructor ]) t
# | Field : 'a datatype * string -> ('a, [< > `Field ]) t
# | Extension : 'a signature * string -> ('a, [< > `Extension ]) t
# | Exception : 'a signature * string -> ('a, [< > `Exception ]) t
# | CoreException : string -> ('a, [< > `Exception ]) t
# | Value : 'a signature * string -> ('a, [< > `Value ]) t
# | Class : 'a signature * string -> ('a, [< > `Class ]) t
# | ClassType : 'a signature * string -> ('a, [< > `ClassType ]) t
# | Method : 'a class_signature * string -> ('a, [< > `Method ]) t
# | InstanceVariable : 'a class_signature * string -> ('a, [< > `InstanceVariable ]) t
# | Label : 'a parent * string -> ('a, [< > `Label ]) t
#
type 'a any = ('a, kind) t
#
type 'a signature = ('a, Kind.signature) t
#
type 'a class_signature = ('a, Kind.class_signature) t
#
type 'a datatype = ('a, Kind.datatype) t
#
type 'a parent = ('a, Kind.parent) t
#
type 'a module_ = ('a, Kind.identifier_module) t
#
type 'a module_type = ('a, Kind.identifier_module_type) t
#
type 'a type_ = ('a, Kind.identifier_type) t
#
type 'a constructor = ('a, Kind.identifier_constructor) t
#
type 'a field = ('a, Kind.identifier_field) t
#
type 'a extension = ('a, Kind.identifier_extension) t
#
type 'a exception_ = ('a, Kind.identifier_exception) t
#
type 'a value = ('a, Kind.identifier_value) t
#
type 'a class_ = ('a, Kind.identifier_class) t
#
type 'a class_type = ('a, Kind.identifier_class_type) t
#
type 'a method_ = ('a, Kind.identifier_method) t
#
type 'a instance_variable = ('a, Kind.identifier_instance_variable) t
#
type 'a label = ('a, Kind.identifier_label) t
#
type 'a path_module = ('a, Kind.path_module) t
#
type 'a path_module_type = ('a, Kind.path_module_type) t
#
type 'a path_type = ('a, Kind.path_type) t
#
type 'a path_class_type = ('a, Kind.path_class_type) t
#
type 'a fragment_module = ('a, Kind.fragment_module) t
#
type 'a fragment_type = ('a, Kind.fragment_type) t
#
type 'a reference_module = ('a, Kind.reference_module) t
#
type 'a reference_module_type = ('a, Kind.reference_module_type) t
#
type 'a reference_type = ('a, Kind.reference_type) t
#
type 'a reference_constructor = ('a, Kind.reference_constructor) t
#
type 'a reference_field = ('a, Kind.reference_field) t
#
type 'a reference_extension = ('a, Kind.reference_extension) t
#
type 'a reference_exception = ('a, Kind.reference_exception) t
#
type 'a reference_value = ('a, Kind.reference_value) t
#
type 'a reference_class = ('a, Kind.reference_class) t
#
type 'a reference_class_type = ('a, Kind.reference_class_type) t
#
type 'a reference_method = ('a, Kind.reference_method) t
#
type 'a reference_instance_variable = ('a, Kind.reference_instance_variable) t
#
type 'a reference_label = ('a, Kind.reference_label) t
#
val signature_of_module : 'a module_ -> 'a signature
#
val signature_of_module_type : 'a module_type -> 'a signature
#
val class_signature_of_class : 'a class_ -> 'a class_signature
#
val class_signature_of_class_type : 'a class_type -> 'a class_signature
#
val datatype_of_type : 'a type_ -> 'a datatype
#
val parent_of_signature : 'a signature -> 'a parent
#
val parent_of_class_signature : 'a class_signature -> 'a parent
#
val parent_of_datatype : 'a datatype -> 'a parent
#
val any : ('a, 'b) t -> 'a any
#
val name : ('a, 'b) t -> string
end

Paths

#
module Path : sig

OCaml paths

#
module Resolved : sig
#
type kind = Kind.path
#
type ('a, 'b) t =
# | Identifier : ('a, 'b) Identifier.t -> ('a, ([< ] as 'b)) t
# | Subst : 'a module_type * ('a, 'b) t -> ('a, ([< > `Module ] as 'b)) t
# | SubstAlias : 'a module_ * ('a, 'b) t -> ('a, ([< > `Module ] as 'b)) t
# | Module : 'a module_ * string -> ('a, [< > `Module ]) t
# | Apply : 'a module_ * 'a Path.module_ -> ('a, [< > `Module ]) t
# | ModuleType : 'a module_ * string -> ('a, [< > `ModuleType ]) t
# | Type : 'a module_ * string -> ('a, [< > `Type ]) t
# | Class : 'a module_ * string -> ('a, [< > `Class ]) t
# | ClassType : 'a module_ * string -> ('a, [< > `ClassType ]) t
#
type 'a any = ('a, kind) t
#
type 'a module_ = ('a, Kind.path_module) t
#
type 'a module_type = ('a, Kind.path_module_type) t
#
type 'a type_ = ('a, Kind.path_type) t
#
type 'a class_type = ('a, Kind.path_class_type) t
#
val ident_module : 'a Identifier.module_ -> ('a, [< > `Module ]) t
#
val ident_module_type : 'a Identifier.module_type -> ('a, [< > `ModuleType ]) t
#
val ident_type : 'a Identifier.type_ -> ('a, [< > `Type ]) t
#
val ident_class : 'a Identifier.class_ -> ('a, [< > `Class ]) t
#
val ident_class_type : 'a Identifier.class_type -> ('a, [< > `ClassType ]) t
#
val any : ('a, 'b) t -> 'a any
#
val identifier : ('a, 'b) t -> ('a, 'b) Identifier.t
end
#
type kind = Kind.path
#
type ('a, 'b) t =
# | Resolved : ('a, 'b) Resolved.t -> ('a, 'b) t
# | Root : string -> ('a, [< > `Module ]) t
# | Dot : 'a module_ * string -> ('a, [< ]) t
# | Apply : 'a module_ * 'a module_ -> ('a, [< > `Module ]) t
#
type 'a any = ('a, kind) t
#
type 'a module_ = ('a, Kind.path_module) t
#
type 'a module_type = ('a, Kind.path_module_type) t
#
type 'a type_ = ('a, Kind.path_type) t
#
type 'a class_type = ('a, Kind.path_class_type) t
#
val ident_module : 'a Identifier.module_ -> ('a, [< > `Module ]) t
#
val ident_module_type : 'a Identifier.module_type -> ('a, [< > `ModuleType ]) t
#
val ident_type : 'a Identifier.type_ -> ('a, [< > `Type ]) t
#
val ident_class : 'a Identifier.class_ -> ('a, [< > `Class ]) t
#
val ident_class_type : 'a Identifier.class_type -> ('a, [< > `ClassType ]) t
#
val any : ('a, 'b) t -> 'a any
#
val module_ : 'a module_ -> string -> ('a, [< > `Module ]) t
#
val apply : 'a module_ -> 'a module_ -> ('a, [< > `Module ]) t
#
val module_type : 'a module_ -> string -> ('a, [< > `ModuleType ]) t
#
val type_ : 'a module_ -> string -> ('a, [< > `Type ]) t
#
val class_ : 'a module_ -> string -> ('a, [< > `Class ]) t
#
val class_type_ : 'a module_ -> string -> ('a, [< > `ClassType ]) t
#
val type_of_class_type : 'a class_type -> 'a type_
end

Fragments

#
module Fragment : sig

OCaml path fragments for specifying module substitutions

#
module Resolved : sig
#
type kind = Kind.fragment
#
type sort = [
| `Root
| `Branch
]
#
type ('a, 'b, 'c) raw =
# | Root : ('a, 'b, [< > `Root ]) raw
# | Subst : 'a Path.Resolved.module_type * ('a, 'b, 'c) raw -> ('a, ([< > `Module ] as 'b), ([< > `Branch ] as 'c)) raw
# | SubstAlias : 'a Path.Resolved.module_ * ('a, 'b, 'c) raw -> ('a, ([< > `Module ] as 'b), ([< > `Branch ] as 'c)) raw
# | Module : 'a signature * string -> ('a, [< > `Module ], [< > `Branch ]) raw
# | Type : 'a signature * string -> ('a, [< > `Type ], [< > `Branch ]) raw
# | Class : 'a signature * string -> ('a, [< > `Class ], [< > `Branch ]) raw
# | ClassType : 'a signature * string -> ('a, [< > `ClassType ], [< > `Branch ]) raw
#
type ('a, 'b) t = ('a, 'b, [
| `Branch
]) raw
#
type 'a any = ('a, kind) t
#
type 'a signature = ('a, Kind.fragment_module, [
| `Root
| `Branch
]) raw
#
type 'a module_ = ('a, Kind.fragment_module) t
#
type 'a type_ = ('a, Kind.fragment_type) t
#
val signature_of_module : 'a module_ -> 'a signature
#
val any : ('a, 'b) t -> 'a any
#
val path : 'a Path.module_ -> ('a, 'b) t -> ('a, 'b) Path.t
#
val identifier : 'a Identifier.signature -> ('a, 'b) t -> ('a, 'b) Identifier.t
#
val split : ('a, 'b) t -> string * ('a, 'b) t option
end
#
type kind = Kind.fragment
#
type sort = [
| `Root
| `Branch
]
#
type ('a, 'b, 'c) raw =
# | Resolved : ('a, 'b, 'c) Resolved.raw -> ('a, 'b, 'c) raw
# | Dot : 'a signature * string -> ('a, [< ], [< > `Branch ]) raw
#
type ('a, 'b) t = ('a, 'b, [
| `Branch
]) raw
#
type 'a any = ('a, kind) t
#
type 'a signature = ('a, Kind.fragment_module, [
| `Root
| `Branch
]) raw
#
type 'a module_ = ('a, Kind.fragment_module) t
#
type 'a type_ = ('a, Kind.fragment_type) t
#
val signature_of_module : 'a module_ -> 'a signature
#
val any : ('a, 'b) t -> 'a any
#
val path : 'a Path.module_ -> ('a, 'b) t -> ('a, 'b) Path.t
#
val split : ('a, 'b) t -> string * ('a, 'b) t option
end

References

#
module Reference : sig

References to definitions

#
module Resolved : sig
#
type kind = Kind.reference
#
type ('a, 'b) t =
# | Identifier : ('a, 'b) Identifier.t -> ('a, 'b) t
# | Module : 'a signature * string -> ('a, [< > `Module ]) t
# | ModuleType : 'a signature * string -> ('a, [< > `ModuleType ]) t
# | Type : 'a signature * string -> ('a, [< > `Type ]) t
# | Constructor : 'a datatype * string -> ('a, [< > `Constructor ]) t
# | Field : 'a datatype * string -> ('a, [< > `Field ]) t
# | Extension : 'a signature * string -> ('a, [< > `Extension ]) t
# | Exception : 'a signature * string -> ('a, [< > `Exception ]) t
# | Value : 'a signature * string -> ('a, [< > `Value ]) t
# | Class : 'a signature * string -> ('a, [< > `Class ]) t
# | ClassType : 'a signature * string -> ('a, [< > `ClassType ]) t
# | Method : 'a class_signature * string -> ('a, [< > `Method ]) t
# | InstanceVariable : 'a class_signature * string -> ('a, [< > `InstanceVariable ]) t
# | Label : 'a parent * string -> ('a, [< > `Label ]) t
#
type 'a any = ('a, kind) t
#
type 'a signature = ('a, Kind.signature) t
#
type 'a class_signature = ('a, Kind.class_signature) t
#
type 'a datatype = ('a, Kind.datatype) t
#
type 'a parent = ('a, Kind.parent) t
#
type 'a module_ = ('a, Kind.reference_module) t
#
type 'a module_type = ('a, Kind.reference_module_type) t
#
type 'a type_ = ('a, Kind.reference_type) t
#
type 'a constructor = ('a, Kind.reference_constructor) t
#
type 'a field = ('a, Kind.reference_field) t
#
type 'a extension = ('a, Kind.reference_extension) t
#
type 'a exception_ = ('a, Kind.reference_exception) t
#
type 'a value = ('a, Kind.reference_value) t
#
type 'a class_ = ('a, Kind.reference_class) t
#
type 'a class_type = ('a, Kind.reference_class_type) t
#
type 'a method_ = ('a, Kind.reference_method) t
#
type 'a instance_variable = ('a, Kind.reference_instance_variable) t
#
type 'a label = ('a, Kind.reference_label) t
#
val ident_module : 'a Identifier.module_ -> ('a, [< > `Module ]) t
#
val ident_module_type : 'a Identifier.module_type -> ('a, [< > `ModuleType ]) t
#
val ident_type : 'a Identifier.type_ -> ('a, [< > `Type ]) t
#
val ident_constructor : 'a Identifier.constructor -> ('a, [< > `Constructor ]) t
#
val ident_field : 'a Identifier.field -> ('a, [< > `Field ]) t
#
val ident_extension : 'a Identifier.extension -> ('a, [< > `Extension ]) t
#
val ident_exception : 'a Identifier.exception_ -> ('a, [< > `Exception ]) t
#
val ident_value : 'a Identifier.value -> ('a, [< > `Value ]) t
#
val ident_class : 'a Identifier.class_ -> ('a, [< > `Class ]) t
#
val ident_class_type : 'a Identifier.class_type -> ('a, [< > `ClassType ]) t
#
val ident_method : 'a Identifier.method_ -> ('a, [< > `Method ]) t
#
val ident_instance_variable : 'a Identifier.instance_variable -> ('a, [< > `InstanceVariable ]) t
#
val ident_label : 'a Identifier.label -> ('a, [< > `Label ]) t
#
val signature_of_module : 'a module_ -> 'a signature
#
val signature_of_module_type : 'a module_type -> 'a signature
#
val class_signature_of_class : 'a class_ -> 'a class_signature
#
val class_signature_of_class_type : 'a class_type -> 'a class_signature
#
val parent_of_signature : 'a signature -> 'a parent
#
val parent_of_class_signature : 'a class_signature -> 'a parent
#
val parent_of_datatype : 'a datatype -> 'a parent
#
val any : ('a, 'b) t -> 'a any
#
val identifier : ('a, 'b) t -> ('a, 'b) Identifier.t
end
#
type kind = Kind.reference
#
type ('a, 'b) t =
# | Resolved : ('a, 'b) Resolved.t -> ('a, 'b) t
# | Root : string -> ('a, [< ]) t
# | Dot : 'a parent * string -> ('a, [< ]) t
#
type 'a any = ('a, kind) t
#
type 'a signature = ('a, Kind.signature) t
#
type 'a class_signature = ('a, Kind.class_signature) t
#
type 'a datatype = ('a, Kind.datatype) t
#
type 'a parent = ('a, Kind.parent) t
#
type 'a module_ = ('a, Kind.reference_module) t
#
type 'a module_type = ('a, Kind.reference_module_type) t
#
type 'a type_ = ('a, Kind.reference_type) t
#
type 'a constructor = ('a, Kind.reference_constructor) t
#
type 'a field = ('a, Kind.reference_field) t
#
type 'a extension = ('a, Kind.reference_extension) t
#
type 'a exception_ = ('a, Kind.reference_exception) t
#
type 'a value = ('a, Kind.reference_value) t
#
type 'a class_ = ('a, Kind.reference_class) t
#
type 'a class_type = ('a, Kind.reference_class_type) t
#
type 'a method_ = ('a, Kind.reference_method) t
#
type 'a instance_variable = ('a, Kind.reference_instance_variable) t
#
type 'a label = ('a, Kind.reference_label) t
#
val ident_module : 'a Identifier.module_ -> ('a, [< > `Module ]) t
#
val ident_module_type : 'a Identifier.module_type -> ('a, [< > `ModuleType ]) t
#
val ident_type : 'a Identifier.type_ -> ('a, [< > `Type ]) t
#
val ident_constructor : 'a Identifier.constructor -> ('a, [< > `Constructor ]) t
#
val ident_field : 'a Identifier.field -> ('a, [< > `Field ]) t
#
val ident_extension : 'a Identifier.extension -> ('a, [< > `Extension ]) t
#
val ident_exception : 'a Identifier.exception_ -> ('a, [< > `Exception ]) t
#
val ident_value : 'a Identifier.value -> ('a, [< > `Value ]) t
#
val ident_class : 'a Identifier.class_ -> ('a, [< > `Class ]) t
#
val ident_class_type : 'a Identifier.class_type -> ('a, [< > `ClassType ]) t
#
val ident_method : 'a Identifier.method_ -> ('a, [< > `Method ]) t
#
val ident_instance_variable : 'a Identifier.instance_variable -> ('a, [< > `InstanceVariable ]) t
#
val ident_label : 'a Identifier.label -> ('a, [< > `Label ]) t
#
val signature_of_module : 'a module_ -> 'a signature
#
val signature_of_module_type : 'a module_type -> 'a signature
#
val class_signature_of_class : 'a class_ -> 'a class_signature
#
val class_signature_of_class_type : 'a class_type -> 'a class_signature
#
val parent_of_signature : 'a signature -> 'a parent
#
val parent_of_class_signature : 'a class_signature -> 'a parent
#
val parent_of_datatype : 'a datatype -> 'a parent
#
val any : ('a, 'b) t -> 'a any
#
val module_ : 'a signature -> string -> ('a, [< > `Module ]) t
#
val module_type : 'a signature -> string -> ('a, [< > `ModuleType ]) t
#
val type_ : 'a signature -> string -> ('a, [< > `Type ]) t
#
val constructor : 'a datatype -> string -> ('a, [< > `Constructor ]) t
#
val field : 'a datatype -> string -> ('a, [< > `Field ]) t
#
val extension : 'a signature -> string -> ('a, [< > `Extension ]) t
#
val exception_ : 'a signature -> string -> ('a, [< > `Exception ]) t
#
val value : 'a signature -> string -> ('a, [< > `Value ]) t
#
val class_ : 'a signature -> string -> ('a, [< > `Class ]) t
#
val class_type : 'a signature -> string -> ('a, [< > `ClassType ]) t
#
val method_ : 'a class_signature -> string -> ('a, [< > `Method ]) t
#
val instance_variable : 'a class_signature -> string -> ('a, [< > `InstanceVariable ]) t
#
val label : 'a parent -> string -> ('a, [< > `Label ]) t
end
end