Module Melange_compiler_libs.Includemod

type mark =
  1. | Mark_both
    /*

    Mark definitions used from both arguments

    */
  2. | Mark_positive
    /*

    Mark definitions used from the positive (first) argument

    */
  3. | Mark_negative
    /*

    Mark definitions used from the negative (second) argument

    */
  4. | Mark_neither
    /*

    Do not mark definitions used from either argument

    */
;

Type describing which arguments of an inclusion to consider as used for the usage warnings. Mark_both is the default.

module Error: { ... };
type explanation = (Env.t, Error.all);
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: field_kind,
};
let kind_of_field_desc: field_desc => string;
let field_desc: field_kind => Ident.t => field_desc;
module FieldMap: Stdlib.Map.S with type key = field_desc;

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

let item_ident_name: Types.signature_item => (Ident.t, Location.t, field_desc);
let is_runtime_component: Types.signature_item => bool;
let modtypes_with_shape: shape:Shape.t => loc:Location.t => Env.t => mark:mark => Types.module_type => Types.module_type => (Typedtree.module_coercion, Shape.t);
let strengthened_module_decl: loc:Location.t => aliasable:bool => Env.t => mark:mark => Types.module_declaration => Path.t => Types.module_declaration => Typedtree.module_coercion;
let check_modtype_inclusion: loc:Location.t => Env.t => Types.module_type => Path.t => Types.module_type => option(explanation);

check_modtype_inclusion ~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.

let check_modtype_equiv: loc:Location.t => Env.t => Ident.t => Types.module_type => Types.module_type => unit;
let compunit: Env.t => mark:mark => string => Types.signature => string => Types.signature => Shape.t => (Typedtree.module_coercion, Shape.t);
let type_declarations: loc:Location.t => Env.t => mark:mark => Ident.t => Types.type_declaration => Types.type_declaration => unit;
let print_coercion: Stdlib.Format.formatter => Typedtree.module_coercion => unit;
type symptom =
  1. | Missing_field(Ident.t, Location.t, string)
  2. | Value_descriptions(Ident.t, Types.value_description, Types.value_description, Includecore.value_mismatch)
  3. | Type_declarations(Ident.t, Types.type_declaration, Types.type_declaration, Includecore.type_mismatch)
  4. | Extension_constructors(Ident.t, Types.extension_constructor, Types.extension_constructor, Includecore.extension_constructor_mismatch)
  5. | Module_types(Types.module_type, Types.module_type)
  6. | Modtype_infos(Ident.t, Types.modtype_declaration, Types.modtype_declaration)
  7. | Modtype_permutation(Types.module_type, Typedtree.module_coercion)
  8. | Interface_mismatch(string, string)
  9. | Class_type_declarations(Ident.t, Types.class_type_declaration, Types.class_type_declaration, list(Ctype.class_match_failure))
  10. | Class_declarations(Ident.t, Types.class_declaration, Types.class_declaration, list(Ctype.class_match_failure))
  11. | Unbound_module_path(Path.t)
  12. | Invalid_module_alias(Path.t)
;
type pos =
  1. | Module(Ident.t)
  2. | Modtype(Ident.t)
  3. | Arg(Types.functor_parameter)
  4. | Body(Types.functor_parameter)
;
exception Error(explanation);
exception Apply_error of {
  1. loc: Location.t,
  2. env: Env.t,
  3. lid_app: option(Longident.t),
  4. mty_f: Types.module_type,
  5. args: list((Error.functor_arg_descr, Types.module_type)),
};
let expand_module_alias: strengthen:bool => Env.t => Path.t => Types.module_type;
module Functor_inclusion_diff: { ... };
module Functor_app_diff: { ... };