From 19ea68ecafcee5199dde1b044fd4be9edc211673 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Tue, 11 Jun 2019 10:49:25 +0200 Subject: Reify libobject containers We make a few libobject constructions (Module, Module Type, Include,...) first-class and rephrase their handling in direct style (removing the inversion of control). This makes it easier to define iterators over objects without hacks like inspecting the tags of dynamic objects. --- library/libobject.mli | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'library/libobject.mli') diff --git a/library/libobject.mli b/library/libobject.mli index a7151d3bf2..3b37db4a6f 100644 --- a/library/libobject.mli +++ b/library/libobject.mli @@ -103,6 +103,22 @@ val ident_subst_function : substitution * 'a -> 'a type obj +type algebraic_objects = + | Objs of objects + | Ref of Names.ModPath.t * Mod_subst.substitution + +and t = + | ModuleObject of substitutive_objects + | ModuleTypeObject of substitutive_objects + | IncludeObject of algebraic_objects + | KeepObject of objects + | ImportObject of { export : bool; mp : Names.ModPath.t } + | AtomicObject of obj + +and objects = (Names.Id.t * t) list + +and substitutive_objects = Names.MBId.t list * algebraic_objects + val declare_object_full : 'a object_declaration -> ('a -> obj) * (obj -> 'a) -- cgit v1.2.3