Page
Library
Module
Module type
Parameter
Class
Class type
Source
Omod_support.CobjCompilation objects
type pkg_id = string * Omod.fpathThe type for package identifiers. A package name and its root directory.
val pp_pkg_id : Format.formatter -> pkg_id -> unitpp_pkg_id formats package identifiers.
type dep = string * Digest.t optionThe type for compilation object dependencies. A module name and an optional interface digest.
val pp_dep : Format.formatter -> dep -> unitpp_dep formats a dependency.
val spec_of_string :
string ->
(string option * string * string list, string) resultspec_of_string s parses a compilation object specification from s. This parses the [PKG.]M(@VARIANT)+ syntax.
val kind_of_string : string -> kind optionkind_of_string s parses s into a kind.
val kind_to_string : kind -> stringkind_to_string k is k as a string.
val exts : Omod.Private.String.Set.texts are the file extensions of compilation objects.
val v :
kind:kind ->
pkg_id:pkg_id ->
name:string ->
iface_digest:Digest.t option ->
iface_deps:dep list ->
in_archive:bool ->
path:Omod.fpath ->
path_loads:t list Lazy.t ->
tv is a compilation object with the given parameters, see the documentation of accessors for semantics.
val add_file : pkg_id:pkg_id -> t list -> Omod.fpath -> (t list, string) resultadd_file ~pkg_id acc f adds the compilation objects of file f in package pkg_id to acc. If f's extension doesn't match a supported compilation object file this is acc.
val name : t -> stringname c is c's capitalized module name (more precisely compilation unit name).
val variant : t -> stringvariant c is c's variant.
val path : t -> Omod.fpathpath c is c's file path.
path_loads c are all the objects that are loaded whenever path is loaded (includes c itself). For paths that point to archives this has all the objects of the archive.
val pp : Format.formatter -> t -> unitpp formats a compilation object.
module Index : sig ... endCompilation object indexes.
type res = t Omod.Private.String.Map.tThe type for dependency resolutions. Maps module names to their resolved object.
val resolve_deps :
variants:Omod.Private.String.Set.t ->
sat:(t -> bool) ->
kind:kind ->
Index.t ->
root_alts:t list list ->
(res list, string) resultresolve_deps ~variants ~sat ~kind i roots is a list of resolutions that recursively resolve the dependencies of the alternative root object roots root_alts to compilation objects of kind kind and satisfying sat using the twists of Index.cobjs_for_dep_res.
fold_res res f acc folds f with acc over the partial dependency order of res raises Invalid_argument if the dependencies of objects in res are not defined in res, this can't happen if the map is a result of resolve_deps.
val loads :
variants:Omod.Private.String.Set.t ->
sat:(t -> bool) ->
kind:kind ->
Index.t ->
root_alts:t list list ->
(Omod.fpath list list, string) resultloads ~sat ~kind i root_alts resolves the alternative root objects roots root_alts to alternative load sequences of object paths of that have objects of kind kind or Cmis (mli-only modules). All the objects involved in the load sequence satisfy sat.