jon.recoil.org

Module Ocaml_typing.Includemod

module Error : sig ... end
type field_kind =
  1. | Field_value
  2. | Field_type
  3. | Field_exception
  4. | Field_typext
  5. | Field_module
  6. | Field_modtype
  7. | Field_class
  8. | Field_classtype
type field_desc = {
  1. name : string;
  2. kind : Ocaml_typing.Includemod.field_kind;
}
val kind_of_field_desc : Ocaml_typing.Includemod.field_desc -> string

Map indexed by both field types and names. This avoids name clashes between different sorts of fields such as values and types.

val is_runtime_component : Ocaml_typing.Types.signature_item -> bool

The modes used for compilation unit inclusion check

val modes_toplevel : Ocaml_typing.Includemod.modes

The modes used for top-level inclusion check, where top-level is similiar to a structure

Takes the mode of functor argument, returns the modes suitable for modal inclusion check against the parameter.

val modes_functor_res : Ocaml_typing.Includemod.modes

The modes used for functor result inclusion check

modtypes_constraint ~shape ~loc env ~mark exp_modtype constraint_modtype checks that exp_modtype is a subtype of constraint_modtype, and returns the module coercion and the shape of the constrained module. It also marks as used paired items in positive position in exp_modtype, and also paired items in negative position in constraint_modtype. This marking in negative position allows to raise an unused item warning whenever an item in a functor parameter in constraint_modtype does not exist in exp_modtypes. This behaviour differs from the one in check_implementation and compunit which assumes that is not appropriate to raise warning about the interface file while typechecking the implementation file.

check_functor_application ~loc env mty1 path1 mty2 checks that the functor application F(M) is well typed, where mty2 is the type of the argument of F and path1/mty1 is the path/unstrenghened type of M.

Check an implementation against an interface

type application_name =
  1. | Anonymous_functor
    (*

    (functor (_:sig end) -> struct end)(Int)

    *)
  2. | Full_application_path of Ocaml_parsing.Longident.t
    (*

    F(G(X).P)(Y)

    *)
  3. | Named_leftmost_functor of Ocaml_parsing.Longident.t
    (*

    F(struct end)...(...)

    *)
val expand_module_alias : strengthen:bool -> Ocaml_typing.Env.t -> Ocaml_typing.Path.t -> Ocaml_typing.Types.module_type
module Functor_inclusion_diff : sig ... end
module Functor_app_diff : sig ... end