package async_kernel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type value := t
type t
val sexp_of_t : t -> Sexplib0.Sexp.t

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

val none : t
val some : value -> t
val is_none : t -> bool
val is_some : t -> bool
val value : t -> default:value -> value

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

val value_exn : t -> value

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.

val to_option : t -> value option
val of_option : value option -> t
module Optional_syntax : Core.Optional_syntax.S with type t := t with type value := value