ocaml-base-compiler
  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Representation and manipulation of modules and module types.

Types

type module_element = Odoc_module.module_element =
  1. | Element_module of t_module
  2. | Element_module_type of t_module_type
  3. | Element_included_module of included_module
  4. | Element_class of Class.t_class
  5. | Element_class_type of Class.t_class_type
  6. | Element_value of Value.t_value
  7. | Element_type_extension of Extension.t_type_extension
  8. | Element_exception of Exception.t_exception
  9. | Element_type of Type.t_type
  10. | Element_module_comment of text

To keep the order of elements in a module.

and mmt = Odoc_module.mmt =
  1. | Mod of t_module
  2. | Modtype of t_module_type

Used where we can reference t_module or t_module_type.

and included_module = Odoc_module.included_module = {
  1. im_name : Name.t;
    (*

    Complete name of the included module.

    *)
  2. mutable im_module : mmt option;
    (*

    The included module or module type, if we found it.

    *)
  3. mutable im_info : Odoc_types.info option;
    (*

    comment associated with the include directive

    *)
}
and module_alias = Odoc_module.module_alias = {
  1. ma_name : Name.t;
    (*

    Complete name of the target module.

    *)
  2. mutable ma_module : mmt option;
    (*

    The real module or module type if we could associate it.

    *)
}
and module_parameter = Odoc_module.module_parameter = {
  1. mp_name : string;
    (*

    the name

    *)
  2. mp_type : Types.module_type option;
    (*

    the type

    *)
  3. mp_type_code : string;
    (*

    the original code

    *)
  4. mp_kind : module_type_kind;
    (*

    the way the parameter was built

    *)
}
and module_kind = Odoc_module.module_kind =
  1. | Module_struct of module_element list
    (*

    A complete module structure.

    *)
  2. | Module_alias of module_alias
    (*

    Complete name and corresponding module if we found it

    *)
  3. | Module_functor of module_parameter * module_kind
    (*

    A functor, with its parameter and the rest of its definition

    *)
  4. | Module_apply of module_kind * module_kind
    (*

    A module defined by application of a functor.

    *)
  5. | Module_with of module_type_kind * string
    (*

    A module whose type is a with ... constraint. Should appear in interface files only.

    *)
  6. | Module_constraint of module_kind * module_type_kind
    (*

    A module constraint by a module type.

    *)
  7. | Module_typeof of string
    (*

    by now only the code of the module expression

    *)
  8. | Module_unpack of string * module_type_alias
    (*

    code of the expression and module type alias

    *)

Different kinds of a module.

and t_module = Odoc_module.t_module = {
  1. m_name : Name.t;
    (*

    Complete name of the module.

    *)
  2. mutable m_type : Types.module_type;
    (*

    The type of the module.

    *)
  3. mutable m_info : info option;
    (*

    Information found in the optional associated comment.

    *)
  4. m_is_interface : bool;
    (*

    true for modules read from interface files

    *)
  5. m_file : string;
    (*

    The file the module is defined in.

    *)
  6. mutable m_kind : module_kind;
    (*

    The way the module is defined.

    *)
  7. mutable m_loc : location;
  8. mutable m_top_deps : Name.t list;
    (*

    The toplevels module names this module depends on.

    *)
  9. mutable m_code : string option;
    (*

    The whole code of the module

    *)
  10. mutable m_code_intf : string option;
    (*

    The whole code of the interface of the module

    *)
  11. m_text_only : bool;
    (*

    true if the module comes from a text file

    *)
}

Representation of a module.

and module_type_alias = Odoc_module.module_type_alias = {
  1. mta_name : Name.t;
    (*

    Complete name of the target module type.

    *)
  2. mutable mta_module : t_module_type option;
    (*

    The real module type if we could associate it.

    *)
}
and module_type_kind = Odoc_module.module_type_kind =
  1. | Module_type_struct of module_element list
    (*

    A complete module signature.

    *)
  2. | Module_type_functor of module_parameter * module_type_kind
    (*

    A functor, with its parameter and the rest of its definition

    *)
  3. | <