package MlFront_Core

  1. Overview
  2. Docs

Module MlFront_Core.LibraryIdSource

Library identifiers.

A library identifier is a double camel cased string followed by an underscore and another camel cased string, like `XyzAbc_Def`.

Sourcetype t = private {
  1. vendor : string;
  2. qualifier : string;
  3. unit : string;
}
Sourceval full_name : t -> string
Sourceval vendor : t -> string
Sourceval qualifier : t -> string
Sourceval unit : t -> string
Sourceval pp : Format.formatter -> t -> unit
Sourceval compare : t -> t -> int
Sourceval hash : t -> int

hash library_id computes a hash value for the given library id.

Sourceval pp_full_name : Format.formatter -> t -> unit
Sourceval parse : ?allow_reserved:unit -> string -> t option

parse ?allow_reserved name will convert the name name to a library if it is a valid MlFront library name. Otherwise None.

The library "ZzZz_Zz" is reserved for internal dk and MlFront use for which parse will return None, unless the ~allow_reserved:() flag is used.

Sourceval parse_exn : ?allow_reserved:unit -> string -> t

parse_exn library creates the library identifier for the library named library.

Raises Invalid_argument when the library is not a valid MlFront library name.

The library "ZzZz_Zz" is reserved for internal dk and MlFront use for which parse_exn will raise Invalid_argument, unless the ~allow_reserved:() flag is used.

Sourceval reserved_unpackaged_library : t

The library "ZzZz_Zz" which is reserved for internal dk and MlFront use.

Special Library Suffixes

A name can be dedicated to a special module for the convenience of build systems. These names are formed by taking the library that the special module belongs to, and adding a suffix.

Library with these suffixes are not MlFront library modules (ex. "DkHelloScript_Std") or MlFront standard modules (ex. "Example001"). They should never be part of a codept analysis and it is an error for code to reference them. But they can form valid OCaml module names (ex. "Example001O__") recognized by both ocamlc and Dune.

And they can also form valid Dune library names (which don't allow single quotes).

Sourceval open_ : t -> string
Sourceval signature_ : t -> string
Sourceval open_suffix : string
Sourceval signature_suffix : string
Sourceval parse_special : string -> (t * [ `Open | `Signature ]) option

If the name represents a library dedicated to a special module, parse_special name will give you the library id and the special module type.

Sourceval suffixes : string list

suffixes is the set of special module suffixes.