Module Modops
Various operations on modules and module types
val is_functor : ('ty, 'a) Declarations.functorize -> boolval destr_functor : ('ty, 'a) Declarations.functorize -> Names.MBId.t * 'ty * ('ty, 'a) Declarations.functorizeval destr_nofunctor : ('ty, 'a) Declarations.functorize -> 'a
val module_type_of_module : Declarations.module_body -> Declarations.module_type_bodyval module_body_of_type : Names.ModPath.t -> Declarations.module_type_body -> Declarations.module_bodyval check_modpath_equiv : Environ.env -> Names.ModPath.t -> Names.ModPath.t -> unitval implem_smartmap : (Declarations.module_signature -> Declarations.module_signature) -> (Declarations.module_expression -> Declarations.module_expression) -> Declarations.module_implementation -> Declarations.module_implementation
Substitutions
val subst_signature : Mod_subst.substitution -> Declarations.module_signature -> Declarations.module_signatureval subst_structure : Mod_subst.substitution -> Declarations.structure_body -> Declarations.structure_body
Adding to an environment
val add_structure : Names.ModPath.t -> Declarations.structure_body -> Mod_subst.delta_resolver -> Environ.env -> Environ.envval add_module : Declarations.module_body -> Environ.env -> Environ.envadds a module and its components, but not the constraints
val add_linked_module : Declarations.module_body -> Environ.link_info -> Environ.env -> Environ.envsame as add_module, but for a module whose native code has been linked by the native compiler. The linking information is updated.
val add_module_type : Names.ModPath.t -> Declarations.module_type_body -> Environ.env -> Environ.envsame, for a module type
val add_retroknowledge : Declarations.module_implementation Declarations.module_retroknowledge -> Environ.env -> Environ.env
Strengthening
val strengthen : Declarations.module_type_body -> Names.ModPath.t -> Declarations.module_type_bodyval inline_delta_resolver : Environ.env -> Entries.inline -> Names.ModPath.t -> Names.MBId.t -> Declarations.module_type_body -> Mod_subst.delta_resolver -> Mod_subst.delta_resolverval strengthen_and_subst_mb : Declarations.module_body -> Names.ModPath.t -> bool -> Declarations.module_bodyval subst_modtype_and_resolver : Declarations.module_type_body -> Names.ModPath.t -> Declarations.module_type_body
Cleaning a module expression from bounded parts
For instance: functor(X:T)->struct module M:=X end) becomes: functor(X:T)->struct module M:=<content of T> end)
val clean_bounded_mod_expr : Declarations.module_signature -> Declarations.module_signature
Errors
type signature_mismatch_error=|InductiveFieldExpected of Declarations.mutual_inductive_body|DefinitionFieldExpected|ModuleFieldExpected|ModuleTypeFieldExpected|NotConvertibleInductiveField of Names.Id.t|NotConvertibleConstructorField of Names.Id.t|NotConvertibleBodyField|NotConvertibleTypeField of Environ.env * Constr.types * Constr.types|CumulativeStatusExpected of bool|PolymorphicStatusExpected of bool|NotSameConstructorNamesField|NotSameInductiveNameInBlockField|FiniteInductiveFieldExpected of bool|InductiveNumbersFieldExpected of int|InductiveParamsNumberField of int|RecordFieldExpected of bool|RecordProjectionsExpected of Names.Name.t list|NotEqualInductiveAliases|IncompatibleUniverses of Univ.univ_inconsistency|IncompatiblePolymorphism of Environ.env * Constr.types * Constr.types|IncompatibleConstraints of{got : Univ.AbstractContext.t;expect : Univ.AbstractContext.t;}|IncompatibleVariancetype module_typing_error=|SignatureMismatch of Names.Label.t * Declarations.structure_field_body * signature_mismatch_error|LabelAlreadyDeclared of Names.Label.t|ApplicationToNotPath of Entries.module_struct_entry|NotAFunctor|IsAFunctor|IncompatibleModuleTypes of Declarations.module_type_body * Declarations.module_type_body|NotEqualModulePaths of Names.ModPath.t * Names.ModPath.t|NoSuchLabel of Names.Label.t|IncompatibleLabels of Names.Label.t * Names.Label.t|NotAModule of string|NotAModuleType of string|NotAConstant of Names.Label.t|IncorrectWithConstraint of Names.Label.t|GenerativeModuleExpected of Names.Label.t|LabelMissing of Names.Label.t * string|IncludeRestrictedFunctor of Names.ModPath.t
exceptionModuleTypingError of module_typing_error
val error_existing_label : Names.Label.t -> 'aval error_incompatible_modtypes : Declarations.module_type_body -> Declarations.module_type_body -> 'aval error_signature_mismatch : Names.Label.t -> Declarations.structure_field_body -> signature_mismatch_error -> 'aval error_incompatible_labels : Names.Label.t -> Names.Label.t -> 'aval error_no_such_label : Names.Label.t -> 'aval error_not_a_module : string -> 'aval error_not_a_constant : Names.Label.t -> 'aval error_incorrect_with_constraint : Names.Label.t -> 'aval error_generative_module_expected : Names.Label.t -> 'aval error_no_such_label_sub : Names.Label.t -> string -> 'aval error_include_restricted_functor : Names.ModPath.t -> 'a