Conventional Module Names

Sourceval is_library : string -> bool

is_library s is true if and only the string s matches the MlFront convention for library names.

Example libraries:

  • "DkHello_Std"

Example non-libraries:

  • "DkHello"
  • "DkHello_Std__A__B".

Inaccurate. Missing full fuzz-testing to get it accurate. The rules are:

  • the name must match "[A-Z][a-z0-9]+[A-Z][A-Za-z0-9]+_[A-Z]_?([A-Za-z0-9]+_)*"
Sourceval is_standard_namespace_term : string -> bool

is_standard_namespace_term s is true if and only the string s matches the MlFront convention for standard module names.

Example standard modules:

  • "DkHello"

Example that are not standard modules:

  • "DkHello_Std"
  • "DkHello_Std__A__B"

Inaccurate. Missing full fuzz-testing to get it accurate. The rules are:

  • the name must match "[A-Z]([A-Za-z0-9]+_?|[A-Za-z0-9]*_[a-z0-9][A-Za-z0-9]*(_[A-Za-z0-9]+)*_?|[A-Z]*[a-z0-9]*(_[A-Za-z0-9]+)*_?)"

Reserved Modules

Sourceval signature_simple_name : string

The special module basename lib__ for a library control module.

Sourceval libopen_simple_name : string

The special module basename open__ for a library open module.

Sourceval proxy_suffix : string

The suffix of the proxy special module.

Sourceval is_signature_module : string -> bool
Sourceval is_libopen_module : string -> bool
Sourceval special_module_type : string -> [ `Signature | `LibOpen | `Proxy ] option
Sourceval is_reserved : string -> bool

Whether or not the module name is reserved for a library control module, library open module, proxy module, or for internal MlFront use.

Parsers

Sourceval parse_library : string -> (string * string * string) option

parse_library s parses the string s and returns the (vendor, qualifier, unit) of the library if s is a valid library name.

Sourceval parse_library_and_namespace : [ `PackageId | `ModuleId ] -> string -> (string * string list, [> `Msg of string ]) Stdlib.result
Sourcemodule InternalUse : sig ... end