Module Ocaml_parsing.Language_extension
Language extensions provided by the Jane Street version of the OCaml compiler.
A setting for extensions that track multiple maturity levels
module Maturity : sig ... endtype 'a t = 'a Ocaml_utils.Language_extension_kernel.t = | Comprehensions : unit Ocaml_parsing.Language_extension.t| Mode : Ocaml_parsing.Language_extension.maturity Ocaml_parsing.Language_extension.t| Unique : Ocaml_parsing.Language_extension.maturity Ocaml_parsing.Language_extension.t| Overwriting : unit Ocaml_parsing.Language_extension.t| Include_functor : unit Ocaml_parsing.Language_extension.t| Polymorphic_parameters : unit Ocaml_parsing.Language_extension.t| Immutable_arrays : unit Ocaml_parsing.Language_extension.t| Module_strengthening : unit Ocaml_parsing.Language_extension.t| Layouts : Ocaml_parsing.Language_extension.maturity Ocaml_parsing.Language_extension.t| SIMD : Ocaml_parsing.Language_extension.maturity Ocaml_parsing.Language_extension.t| Labeled_tuples : unit Ocaml_parsing.Language_extension.t| Small_numbers : Ocaml_parsing.Language_extension.maturity Ocaml_parsing.Language_extension.t| Instances : unit Ocaml_parsing.Language_extension.t| Separability : unit Ocaml_parsing.Language_extension.t| Let_mutable : unit Ocaml_parsing.Language_extension.t| Layout_poly : Ocaml_parsing.Language_extension.maturity Ocaml_parsing.Language_extension.t| Runtime_metaprogramming : unit Ocaml_parsing.Language_extension.t
The type of language extensions. An 'a t is an extension that can either be off or be set to have any value in 'a, so a unit t can be either on or off, while a maturity t can have different maturity settings.
val assert_enabled :
loc:Ocaml_parsing.Location.t ->
'a Ocaml_parsing.Language_extension.t ->
'a ->
unitRequire that an extension is enabled for at least the provided level, or else throw an exception at the provided location saying otherwise.
val maturity_of_unique_for_drf : Ocaml_parsing.Language_extension.maturityval maturity_of_unique_for_destruction :
Ocaml_parsing.Language_extension.maturitymodule Exist : sig ... endExistentially packed language extension
val equal :
'a Ocaml_parsing.Language_extension.t ->
'b Ocaml_parsing.Language_extension.t ->
boolEquality on language extensions
module Universe : sig ... endThe type of language extension universes. Each universe allows a set of extensions, and every successive universe includes the previous one.
val is_erasable : 'a Ocaml_parsing.Language_extension.t -> boolCheck if a language extension is "erasable", i.e. whether it can be harmlessly translated to attributes and compiled with the upstream compiler.
val to_string : 'a Ocaml_parsing.Language_extension.t -> stringPrint and parse language extensions; parsing is case-insensitive
val to_command_line_string :
'a Ocaml_parsing.Language_extension.t ->
'a ->
stringval of_string : string -> Ocaml_parsing.Language_extension.Exist.t optionval maturity_to_string : Ocaml_parsing.Language_extension.maturity -> stringval get_command_line_string_if_enabled :
'a Ocaml_parsing.Language_extension.t ->
string optionGet the command line string enabling the given extension, if it's enabled; otherwise None
Enable and disable according to command-line strings; these raise an exception if the input string is invalid.
val set : unit Ocaml_parsing.Language_extension.t -> enabled:bool -> unitEnable and disable language extensions; these operations are idempotent
val enable : 'a Ocaml_parsing.Language_extension.t -> 'a -> unitval disable : 'a Ocaml_parsing.Language_extension.t -> unitval is_enabled : 'a Ocaml_parsing.Language_extension.t -> boolCheck if a language extension is currently enabled (at any maturity level)
val is_at_least : 'a Ocaml_parsing.Language_extension.t -> 'a -> boolCheck if a language extension is enabled at least at the given level
val with_set :
unit Ocaml_parsing.Language_extension.t ->
enabled:bool ->
(unit -> unit) ->
unitTooling support: Temporarily enable and disable language extensions; these operations are idempotent. Calls to set, enable, disable inside the body of the function argument will also be rolled back when the function finishes, but this behavior may change; nest multiple with_* functions instead.
val with_enabled :
'a Ocaml_parsing.Language_extension.t ->
'a ->
(unit -> unit) ->
unitval with_disabled :
'a Ocaml_parsing.Language_extension.t ->
(unit -> unit) ->
unitCheck if the allowable extensions are restricted to only those that are "erasable". This is true when the universe is set to No_extensions or Upstream_compatible.
val set_universe_and_enable_all :
Ocaml_parsing.Language_extension.Universe.t ->
unitSet the extension universe and enable all allowed extensions.