package MlFront_Core

  1. Overview
  2. Docs

Module MlFront_Core.UnitModsSource

The module UnitMods represents the ordered list of modifications to a compilation unit like opening modules and adding alerts that result from a MlFront analysis of the project.

The type t is opaque for serialization to disk.

Sourcetype library_aliased = {
  1. bound_name : string;
  2. qualified_module_id : string;
  3. unwrapper_opt : string option;
}

A library that is aliased as a (usually simpler) module.

Examples include:

  • [("M", "SomeThing_Std", None)] which would be "module M = SomeThing_Std" for an unwrapped library
  • [("M", "SomeThing_Std", Some "N")] which would be "module M = SomeThing_Std.N" for a wrapped library
  • [("M", "SomeThing_Std__One", None)] which would be "module M = SomeThing_Std__One" for the qualified module id form of a script library.
Sourcetype t = {
  1. no_standard_lib : bool;
    (*

    no_standard_lib is true if and only if no OCaml standard library should be given to the compilation unit.

    *)
  2. module_alert_specs : string list;
    (*

    module_alert_specs are the list of alert specs that will be added to the top of the compilation unit.

    Examples include:

    • ["-all--all+unix@window"]; ["@need_dkcoder_stdlib"]
    *)
  3. libraries_aliased : library_aliased list;
    (*

    libraries_aliased are the list of module aliases at the top of the compilation unit that represent the import of libraries.

    *)
  4. modules_opened : string list;
    (*

    modules_opened are the list of modules to be opened at the top of the compilation unit.

    Examples include:

    • ["Stdlib414Shadow"]; ["Notstripe_o.Open__"]
    *)
  5. unmodelled_ocamlc_opt_compile_flags : string list;
    (*

    unmodelled_ocamlc_opt_compile_flags are compile flags for ocamlc and ocamlopt that are not modelled in codept and/or can't be modelled in a PPX for Merlin (ie. dkcoder-ppx).

    The flags should be given by the build system to ocamlc and ocamlopt.

    *)
  6. unmodelled_libraries : string list;
}
Sourceval pp_library_aliased : Format.formatter -> library_aliased -> unit
Sourceval pp : Format.formatter -> t -> unit
Sourceval none_with_standard_lib : t

none_with_standard_lib is no modifications.

Sourceval none_with_no_standard_lib : t

none_with_no_standard_lib is no modifications and no standard library.

Sourceval union : t -> t -> t

union mods1 mods2 are the modifications of mods1 with mods2 applied after.

If any of the modifications has the standard library, then the union has the standard library.