package MlFront_Core

  1. Overview
  2. Docs

Module MlFront_Core.QualifiedModuleNameSource

QualifiedModuleName provides operations to compress a standard module identifier. The compression can significantly reduce pressure on limited path-length file systems like 260-char Windows.

The compression is lossy so the LibraryId.t portion of the module identifier is never compressed. Keeping the LibraryId.t uncompressed allows MlFront to reliably group these (partially) compressed module identifiers by library. And because LibraryId.t are necessary for linking ".cma", MlFront can do whole-project module dependency analysis (ex. codept) and know exactly what libraries are necessary to compile and link the project.

Sourcetype t = private {
  1. standard_module_id : StandardModuleId.t;
  2. fixedlength : bool;
}
Sourceval pp : Format.formatter -> t -> unit
Sourceval compare : t -> t -> int
Sourceval create : fixedlength:bool -> StandardModuleId.t -> t

create ~fixedlength module_id creates a qualified module id from module_id.

The qualified module id will be a fixed length when ~fixedlength = true. Otherwise it will be a possibly very long module id formed from the module paths.

Sourceval standard_module_id : t -> StandardModuleId.t

standard_module_id t.

Sourceval short_name : t -> string

short_name qualified_module_id returns a string with the full name of the library concatenated with a double underscore (__), and then concatenated with either a fixed-length compression of the module path, or the module path separated by double underscores.

If the module is a libcontrol module or other special module then the module id path is considered to be "<name of library>'".

Sourceval full_name : StandardModuleId.t -> string

full_name module_id is the library concatenated with a double underscore (__) and then concatenated with the module path separated by double underscores.

It is never a fixed length representation.