package MlFront_Core

  1. Overview
  2. Docs

Module MlFront_Core.SpecialModuleIdSource

A SpecialModuleId is-a ModuleId.

Sourcetype typ =
  1. | SignatureModule
    (*

    The simple name is ModuleParsing.signature_simple_name. Currently these are not user-creatable but are auto-created from codept/dkproject.jsonc signature files, but could be extended to restrict the interface of a library. Unlike a Dune wrapper, this would be a signature constraint (so some subset of the inferred .mli) rather than a open remapping of the library.

    *)
  2. | LibOpenModule
    (*

    The simple name is ModuleParsing.libopen_simple_name.

    *)
  3. | ProxyModule of {
    1. namespace_front : string list;
    2. namespace_tail : string;
    }
Sourcetype t = private {
  1. library_id : LibraryId.t;
    (*

    The library the module belongs to.

    *)
  2. typ : typ;
}
Sourceval pp : Format.formatter -> t -> unit
Sourceval compare : t -> t -> int
Sourceval hash : t -> int
Sourceval create_signature : LibraryId.t -> t

create_signature library_id creates a special module of type SignatureModule for the library library_id.

Sourceval create_libopen : LibraryId.t -> t

create_libopen library_id creates a special module of type LibOpenModule for the library library_id.

Sourceval create_proxy_of_standard_module_id : library_id:LibraryId.t -> namespace_front:string list -> namespace_tail:string -> t

create_proxy_of_standard_module_id ~library_id ~namespace_front ~namespace_tail creates a special module that is a proxy for the standard module having namespace_front and namespace_tail.

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

pp_except_library_id ppf t prints the special module id t to the pretty printer ppf except the library id component.

Sourceval json : t -> [> `O of (string * [> `String of string ]) list ]

json module_id returns the canonical JSON representation of the special module id module_id.

The representation is compatible with Ezjsonm.

Sourceval show_friendly_description : t -> string

show_friendly_description module_id returns a human-friendly single-line description of the module.

Sourceval show_double_underscore : t -> string

show_underscore module_id returns a string with the library concatenated with a double underscore (__) and then concatenated with the module id path seperated by double underscores.

The module id path will be ModuleParsing.signature_simple_name, ModuleParsing.libopen_simple_name or the StandardModuleId module id path with a ModuleParsing.proxy_suffix appended.

Casting

Sourceval cast_as_unit_id : t -> [ `PackageId of PackageId.t | `SpecialModuleId of t ]

cast_as_unit_id module_id is the module module_id upcast to a UnitId.t.

Sourceval downcast_unit_id : [ `PackageId of PackageId.t | `SpecialModuleId of t ] -> t option

downcast_package_id unit_id tries to convert the unit identifier unit_id to a special module id.