package ocaml-version

  1. Overview
  2. Docs

Configuration parameters that affect the behaviour of OCaml at compiler-build-time.

type o = [
  1. | `Afl
  2. | `Default_unsafe_string
  3. | `Disable_flat_float_array
  4. | `Domains
  5. | `Effects
  6. | `Flambda
  7. | `Force_safe_string
  8. | `Frame_pointer
  9. | `Multicore
  10. | `Multicore_no_effect_syntax
  11. | `No_naked_pointers
  12. | `No_naked_pointers_checker
]

Configuration options available at compiler build time.

val to_string : o -> string

to_string o returns a compact representation of o suitable for use in opam version strings.

val of_string : string -> o option

of_string s will parse the output of to_string back into an option o. Returns None if the string input is unknown.

val of_t : t -> (o list, [> `Msg of string ]) Stdlib.result

of_t t will parse the extra field of t and return a list of configure options that it represents. Unknown options in the extra field will result in an Error being returned.

val to_t : t -> o list -> t

to_t t ol will replace the extra field of t with the list of options represented in ol.

val to_description : o -> string

to_description o returns a human-readable representation of o.

val to_configure_flag : t -> o -> string

to_configure_flag o returns a string that can be passed to OCaml's configure script to activate that feature.

val compare : t -> o -> o -> int

compare t a b will return -1 if a is < b, 0 if they are equal, or 1 if a > b. For backwards compatibility reasons, Frame_pointer always comes first in comparisons before OCaml 4.12.0, and is lexically ordered after 4.12.0. The t argument will determine which comparison function to use.

val equal : t -> o -> o -> bool

equal t a b will return true if a=b for a given OCaml version t.

val is_multicore : t -> bool

is_multicore t is true if this version is a multicore-capable release.