Module Mod_declarations

type 'a generic_module_body

For a module, there are five possible situations:

A module_type_body is just a module_body with no implementation and also an empty mod_retroknowledge. Its mod_type_alg contains the algebraic definition of this module type, or None if it has been built interactively.

A module signature is a structure, with possibly functors on top of it

type module_implementation =
| Abstract(*

no accessible implementation

*)
| Algebraic of Declarations.module_expression(*

non-interactive algebraic expression

*)
| Struct of structure_body(*

interactive body living in the parameter context of mod_type

*)
| FullStruct(*

special case of Struct : the body is exactly mod_type

*)

Extra invariants :

Accessors
val mod_type_alg : 'a generic_module_body -> Declarations.module_expression option
val mod_retroknowledge : module_body -> Retroknowledge.action list
val mod_global_delta : 'a generic_module_body -> Mod_subst.delta_resolver option

None if the argument is a functor, mod_delta otherwise

Builders
val module_type_of_module : module_body -> module_type_body
val module_body_of_type : module_type_body -> module_body
val functorize_module : (Names.MBId.t * module_type_body) list -> module_body -> module_body
Setters
val set_implementation : module_implementation -> module_body -> module_body
val set_retroknowledge : module_body -> Retroknowledge.action list -> module_body
Substitution
type subst_kind
val subst_dom : subst_kind
val subst_codom : subst_kind
val subst_dom_codom : subst_kind
val subst_shallow_dom_codom : Mod_subst.substitution -> subst_kind
Hashconsing
val hcons_generic_module_body : 'a generic_module_body -> 'a generic_module_body
val hcons_module_body : module_body -> module_body
val hcons_module_type : module_type_body -> 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_structure : Names.MBIset.t -> structure_body -> structure_body