package omod

  1. Overview
  2. Docs
Lookup and load installed OCaml modules

Install

dune-project
 Dependency

Authors

Maintainers

Sources

omod-0.0.4.tbz
sha512=cab9e8ab6ca6e836fdaa3dcf9552d31e4de2bf069fcab096c1565d204ff91fc3516cd017a13702d749580bd3563c462db3277ab036cfc5d3cb9703a08ddbb927

doc/omod.support/Omod_support/Pkg/index.html

Module Omod_support.PkgSource

Packages.

Packages represents sets of compilation objects indexed from a root Conf.libdir.

Packages

The type for packages.

Sourceval of_dir : ?err:Log.t -> Omod.fpath -> t list

of_dir ~err dir are the packages found in dir. This is simply all the directory names inside dir and an ocaml package which points to ocamlc -where. err is used to report file system errors (defaults to Log.err).

Sourceval find_cobjs : ?err:Log.t -> ?acc:Cobj.t list -> t -> Cobj.t list

find_cobjs ~err ~note ~acc pkg are the compilation objects contained in pkg pkg added to acc (defaults to []). err is used to report errors (defaults to Log.nil).

Sourceval equal : t -> t -> bool

equal p0 p1 is true iff p0 and p1 have the same identifiers.

Sourceval compare : t -> t -> int

compare is a total order on packages compatible with equal.

Sourceval pp : Format.formatter -> t -> unit

pp formats package identifiers.

Sourceval pp_name : Format.formatter -> t -> unit

pp_name formats the name of package identifiers.

Sourcemodule Set : Set.S with type elt = t

Package identifier sets.

Sourcemodule Map : Map.S with type key = t

Package identifier maps.

Package signatures

Sourcetype signature = Digest.t

The type for package signatures.

Sourceval signature : ?err:Log.t -> t -> signature

signature ~err pkg is a signature for package pkg. This is the digest of the mtimes of all the cobjs of pkg. err is used to report error (defaults to Log.err).

Package information

Sourcetype info

The type for package information.

Sourceval info : signature:signature -> cobjs:Cobj.t list -> info

info ~signature ~cobjs is information for a package.

Sourceval info_signature : info -> signature

info_signature i is the package's signature.

Sourceval info_cobjs : info -> Cobj.t list

info_signature i is the package's compilation objects.

Sourceval pp_info : Format.formatter -> info -> unit

pp_info formats package information.

Package databases

Sourcetype db = info Map.t

The type for package databases. Maps package names to their information.

Sourceval db : ?err:Log.t -> ?note:Log.t -> ?progress:bool -> ?init:db -> t list -> db

db ~err ~note ~progress ~init pkgs is database init (defaults to Map.empty) with packages pkgs added. Their information is computed by the function using err to report errors (defaults to Log.err), note to report indexing operations (defaults to Log.nil) and progress to indicate if progress should be reported on note (defaults to false).

Sourceval db_to_name_db : db -> (t * info) Omod.Private.String.Map.t

db_to_name_db db maps package names (rather than identifiers) to their information.

Sourceval db_to_cobj_index : db -> Cobj.Index.t

db_to_cobj_index db is a compilation object with the contents of the packages of db.

Sourcetype diff = [
  1. | `New of t * signature
  2. | `Changed of t * signature
  3. | `Gone of t
]

The type for package database differences.

  • `New (pkg, sg), package pkg with signature sg is new.
  • `Gone pkg, package pkg was removed.
  • `Changed (pkg, sg), package pkg changed to signature sg.

pp_diff formats package database differences.

Sourceval diff : db -> (t * signature) list -> diff list

diff db sgs is the list of difference between db and package signatures sgs.

Sourceval update : ?err:Log.t -> ?note:Log.t -> ?progress:bool -> db -> diff list -> db

udpate ~err ~note ~progress db diffs is db updated according to diffs. err is used to report errors (defaults to Log.err), note to report indexing operations (defaults to Log.nil) and progress to indicate if progress should be reported on note (defaults to false).