Module Ocaml_typing.Mode

include Mode_intf.S
val print_longident : (Format.formatter -> Ocaml_parsing.Longident.t -> unit) ref
val erase_hints : unit -> unit

Remove hints from all variables that have been created. See the comments on erase_hint in Solver_intf for details.

module Hint = Mode_hint
val print_pinpoint : Hint.pinpoint -> (definite:bool -> capitalize:bool -> Format.formatter -> unit) option

Prints a pinpoint. Say "a foo" if definite is false, say "the foo" otherwise. Defaults to the latter.

type nonrec 'a simple_error = 'a Mode_intf.simple_error
type changes
val undo_changes : changes -> unit
val set_append_changes : (changes ref -> unit) -> unit
type nonrec allowed = Allowance.allowed
type nonrec disallowed = Allowance.disallowed
type nonrec equate_step = Mode_intf.equate_step
type ('a, 'd) mode constraint 'd = 'l * 'r
type ('a, 'b) monadic_comonadic = {
  1. monadic : 'a;
  2. comonadic : 'b;
}
module type Common_axis_pos = sig ... end
module type Common_axis_neg = sig ... end
module Locality : sig ... end
module Regionality : sig ... end
module Linearity : sig ... end
module Portability : sig ... end
module Uniqueness : sig ... end
module Contention : sig ... end
module Forkable : sig ... end
module Yielding : sig ... end
module Statefulness : sig ... end
module Visibility : sig ... end
module Staticity : sig ... end
type 'a comonadic_with = {
  1. areality : 'a;
  2. linearity : Linearity.Const.t;
  3. portability : Portability.Const.t;
  4. forkable : Forkable.Const.t;
  5. yielding : Yielding.Const.t;
  6. statefulness : Statefulness.Const.t;
}
type monadic = {
  1. uniqueness : Uniqueness.Const.t;
  2. contention : Contention.Const.t;
  3. visibility : Visibility.Const.t;
  4. staticity : Staticity.Const.t;
}
module Axis : sig ... end
module Value : sig ... end

The most general mode. Used in most type checking, including in value bindings in Env

module Alloc : sig ... end

The mode on arrow types. Compared to Value, it contains the Locality axis instead of Regionality axis, as arrow types are exposed to users and would be hard to understand if it involves Regionality.

module Const : sig ... end
val regional_to_local : ('l * 'r) Regionality.t -> ('l * 'r) Locality.t

Converts regional to local, identity otherwise

val locality_as_regionality : ('l * 'r) Locality.t -> ('l * 'r) Regionality.t

Inject locality into regionality

val regional_to_global : ('l * 'r) Regionality.t -> ('l * 'r) Locality.t

Converts regional to global, identity otherwise

val alloc_as_value : ('l * 'r) Alloc.t -> ('l * 'r) Value.t

Similar to locality_as_regionality, behaves as identity on other axes

val alloc_to_value_l2r : ('l * 'r) Alloc.t -> ('l * disallowed) Value.t

Similar to local_to_regional, behaves as identity in other axes

val value_to_alloc_r2l : ('l * 'r) Value.t -> ('l * 'r) Alloc.t

Similar to regional_to_local, behaves as identity on other axes

val value_to_alloc_r2g : ('l * 'r) Value.t -> ('l * 'r) Alloc.t

Similar to regional_to_global, behaves as identity on other axes

val value_r2g : ?hint:('l * 'r) Hint.morph -> ('l * 'r) Value.t -> ('l * 'r) Value.t

Similar to value_to_alloc_r2g, but followed by alloc_as_value.

module Modality : sig ... end
module Crossing : sig ... end

Some modes on an axis might be indistinguishable for values of some type, in which case the actual mode of values can be strenghthened (or equivalently the expected mode loosened) accordingly to make more programs mode-check. The capabilities/permissions to perform such adjustments are called mode crossing and depicted in this module.