Module Omod_support.Cobj
Compilation objects
Package identifiers
type pkg_id= string * Omod.fpathThe type for package identifiers. A package name and its root directory.
val pp_pkg_id : Stdlib.Format.formatter -> pkg_id -> unitpp_pkg_idformats package identifiers.
Dependencies
type dep= string * Digest.t optionThe type for compilation object dependencies. A module name and an optional interface digest.
val pp_dep : Stdlib.Format.formatter -> dep -> unitpp_depformats a dependency.
Specifications
val spec_of_string : string -> (string option * string * string list, string) Stdlib.resultspec_of_string sparses a compilation object specification froms. This parses the[PKG.]M(\@VARIANT)+syntax.
Compilation objects
val kind_of_string : string -> kind optionkind_of_string sparsessinto a kind.
val kind_to_string : kind -> stringkind_to_string kiskas a string.
val exts : Omod.Private.String.Set.textsare 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 Stdlib.Lazy.t -> tvis 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) Stdlib.resultadd_file ~pkg_id acc fadds the compilation objects of filefin packagepkg_idtoacc. Iff's extension doesn't match a supported compilation object file this isacc.
val name : t -> stringname cisc's capitalized module name (more precisely compilation unit name).
val variant : t -> stringvariant cisc's variant.
val path : t -> Omod.fpathpath cisc's file path.
Predicates
Formatters
val pp : Stdlib.Format.formatter -> t -> unitppformats a compilation object.
Indexes and dependency resolvers
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) Stdlib.resultresolve_deps ~variants ~sat ~kind i rootsis a list of resolutions that recursively resolve the dependencies of the alternative root object rootsroot_altsto compilation objects of kindkindand satisfyingsatusing the twists ofIndex.cobjs_for_dep_res.
val fold_res : res -> (t -> 'a -> 'a) -> 'a -> 'afold_res res f accfoldsfwithaccover the partial dependency order ofres- raises Invalid_argument
if the dependencies of objects in
resare not defined inres, this can't happen if the map is a result ofresolve_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) Stdlib.resultloads ~sat ~kind i root_altsresolves the alternative root objects rootsroot_altsto alternative load sequences of object paths of that have objects of kindkindorCmis (mli-only modules). All the objects involved in the load sequence satisfysat.