package core_extended

  1. Overview
  2. Docs
Extra components that are not as closely vetted or as stable as Core

Install

Dune Dependency

Authors

Maintainers

Sources

v0.17.0.tar.gz
sha256=17de5f7cf59818d757bb0625c55f0afc84509122645b7782fb522ac98c3be446

doc/core_extended.immediate/Immediate/String/Option/index.html

Module String.OptionSource

include Immediate_kernel.Option with type value := t
include Core.Immediate_option.S with type value := t
Sourcetype t
include Core.Immediate_option_intf.S_without_immediate with type t := t with type value := t
include Ppx_compare_lib.Comparable.S with type t := t
include Ppx_hash_lib.Hashable.S with type t := t
include Core.Immediate_option_intf.S_without_immediate_plain with type t := t with type value := t

Constructors analogous to None and Some. If not (some_is_representable x) then some x may raise or return none.

Sourceval none : t
Sourceval some : t -> t
Sourceval some_is_representable : t -> Base.Bool.t

For some representations of immediate options, the encodings of none and some overlap. For these representations, some_is_representable value = false if value cannot be represented as an option. For example, Int.Option uses min_value to represent none. For other representations, some_is_representable always returns true.

Sourceval is_none : t -> Base.Bool.t
Sourceval is_some : t -> Base.Bool.t
Sourceval value : t -> default:t -> t

value (some x) ~default = x and value none ~default = default.

Sourceval value_exn : t -> t

value_exn (some x) = x. value_exn none raises. Unlike Option.value_exn, there is no ?message argument, so that calls to value_exn that do not raise also do not have to allocate.

Sourceval unchecked_value : t -> t

unchecked_value (some x) = x. unchecked_value none returns an unspecified value. unchecked_value t is intended as an optimization of value_exn t when is_some t is known to be true.

Sourceval to_option : t -> t Base.Option.t
Sourceval of_option : t Base.Option.t -> t
Sourcemodule Optional_syntax : Core.Optional_syntax.S with type t := t with type value := t
include Core.Identifiable.S with type t := t
include Bin_prot.Binable.S with type t := t
include Bin_prot.Binable.S_only_functions with type t := t
Sourceval bin_size_t : t Bin_prot.Size.sizer
Sourceval bin_write_t : t Bin_prot.Write.writer
Sourceval bin_read_t : t Bin_prot.Read.reader
Sourceval __bin_read_t__ : (int -> t) Bin_prot.Read.reader

This function only needs implementation if t exposed to be a polymorphic variant. Despite what the type reads, this does *not* produce a function after reading; instead it takes the constructor tag (int) before reading and reads the rest of the variant t afterwards.

Sourceval bin_shape_t : Bin_prot.Shape.t
include Ppx_hash_lib.Hashable.S with type t := t
include Sexplib0.Sexpable.S with type t := t
Sourceval t_of_sexp : Sexplib0.Sexp.t -> t
include Ppx_compare_lib.Comparable.S with type t := t
include Ppx_hash_lib.Hashable.S with type t := t
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
include Base.Stringable.S with type t := t
Sourceval of_string : string -> t
Sourceval to_string : t -> string
include Base.Pretty_printer.S with type t := t
Sourceval pp : Base.Formatter.t -> t -> unit
include Core.Comparable.S_binable with type t := t
include Base.Comparable.S with type t := t
include Base.Comparisons.S with type t := t
include Base.Comparisons.Infix with type t := t
Sourceval (>=) : t -> t -> bool
Sourceval (<=) : t -> t -> bool
Sourceval (=) : t -> t -> bool
Sourceval (>) : t -> t -> bool
Sourceval (<) : t -> t -> bool
Sourceval (<>) : t -> t -> bool
Sourceval compare : t -> t -> int

compare t1 t2 returns 0 if t1 is equal to t2, a negative integer if t1 is less than t2, and a positive integer if t1 is greater than t2.

Sourceval min : t -> t -> t
Sourceval max : t -> t -> t
Sourceval ascending : t -> t -> int

ascending is identical to compare. descending x y = ascending y x. These are intended to be mnemonic when used like List.sort ~compare:ascending and List.sort ~cmp:descending, since they cause the list to be sorted in ascending or descending order, respectively.

Sourceval descending : t -> t -> int
Sourceval between : t -> low:t -> high:t -> bool

between t ~low ~high means low <= t <= high

Sourceval clamp_exn : t -> min:t -> max:t -> t

clamp_exn t ~min ~max returns t', the closest value to t such that between t' ~low:min ~high:max is true.

Raises if not (min <= max).

Sourceval clamp : t -> min:t -> max:t -> t Base.Or_error.t
include Base.Comparator.S with type t := t
Sourcetype comparator_witness
Sourceval validate_lbound : min:t Core.Maybe_bound.t -> t Validate.check
Sourceval validate_ubound : max:t Core.Maybe_bound.t -> t Validate.check
Sourceval validate_bound : min:t Core.Maybe_bound.t -> max:t Core.Maybe_bound.t -> t Validate.check
include Core.Hashable.S_binable with type t := t
include Ppx_hash_lib.Hashable.S with type t := t
Sourceval hash_fold_t : Base.Hash.state -> t -> Base.Hash.state
Sourceval hashable : t Base.Hashable.t
include Core.Equal.S with type t := t
Sourceval of_string_option : string option -> t
Sourceval to_string_option : t -> string option
Sourcemodule Stable : sig ... end
Sourcemodule For_testing_only : sig ... end
Sourceval to_immediate_string_option : t -> t
Sourceval of_immediate_string_option : t -> t
OCaml

Innovation. Community. Security.