package tezos-error-monad

  1. Overview
  2. Docs
type !'a t = 'a option =
  1. | None
  2. | Some of 'a
val none : 'a option
val none_e : ('a option, 'trace) result
val none_s : 'a option Lwt.t
val none_es : ('a option, 'trace) result Lwt.t
val some : 'a -> 'a option
val some_unit : unit option
val some_unit_e : (unit option, 'error) result
val some_unit_s : unit option Lwt.t
val some_unit_es : (unit option, 'error) result Lwt.t
val some_nil : 'a list option
val some_nil_e : ('a list option, 'error) result
val some_nil_s : 'a list option Lwt.t
val some_nil_es : ('a list option, 'error) result Lwt.t
val some_true : bool option
val some_true_e : (bool option, 'error) result
val some_true_s : bool option Lwt.t
val some_true_es : (bool option, 'error) result Lwt.t
val some_false : bool option
val some_false_e : (bool option, 'error) result
val some_false_s : bool option Lwt.t
val some_false_es : (bool option, 'error) result Lwt.t
val some_e : 'a -> ('a option, 'trace) result
val some_s : 'a -> 'a option Lwt.t
val some_es : 'a -> ('a option, 'trace) result Lwt.t
val value : 'a option -> default:'a -> 'a
val value_e : 'a option -> error:'trace -> ('a, 'trace) result
val value_f : 'a option -> default:(unit -> 'a) -> 'a
val value_fe : 'a option -> error:(unit -> 'trace) -> ('a, 'trace) result
val bind : 'a option -> ('a -> 'b option) -> 'b option
val join : 'a option option -> 'a option
val either : 'a option -> 'a option -> 'a option
val either_f : 'a option -> (unit -> 'a option) -> 'a option
val merge : ('a -> 'a -> 'a) -> 'a option -> 'a option -> 'a option
val merge_e : ('a -> 'a -> ('a, 'e) result) -> 'a option -> 'a option -> ('a option, 'e) result
val merge_s : ('a -> 'a -> 'a Lwt.t) -> 'a option -> 'a option -> 'a option Lwt.t
val merge_es : ('a -> 'a -> ('a, 'e) result Lwt.t) -> 'a option -> 'a option -> ('a option, 'e) result Lwt.t
val map : ('a -> 'b) -> 'a option -> 'b option
val map_s : ('a -> 'b Lwt.t) -> 'a option -> 'b option Lwt.t
val map_e : ('a -> ('b, 'trace) result) -> 'a option -> ('b option, 'trace) result
val map_es : ('a -> ('b, 'trace) result Lwt.t) -> 'a option -> ('b option, 'trace) result Lwt.t
val fold : none:'a -> some:('b -> 'a) -> 'b option -> 'a
val fold_s : none:'a -> some:('b -> 'a Lwt.t) -> 'b option -> 'a Lwt.t
val fold_f : none:(unit -> 'a) -> some:('b -> 'a) -> 'b option -> 'a
val filter : ('a -> bool) -> 'a option -> 'a option
val filter_map : ('a -> 'b option) -> 'a option -> 'b option
val filter_s : ('a -> bool Lwt.t) -> 'a option -> 'a option Lwt.t
val filter_map_s : ('a -> 'b option Lwt.t) -> 'a option -> 'b option Lwt.t
val filter_e : ('a -> (bool, 'e) result) -> 'a option -> ('a option, 'e) result
val filter_map_e : ('a -> ('b option, 'e) result) -> 'a option -> ('b option, 'e) result
val filter_es : ('a -> (bool, 'e) result Lwt.t) -> 'a option -> ('a option, 'e) result Lwt.t
val filter_map_es : ('a -> ('b option, 'e) result Lwt.t) -> 'a option -> ('b option, 'e) result Lwt.t
val filter_ok : ('a, 'e) result option -> 'a option
val filter_error : ('a, 'e) result option -> 'e option
val filter_left : ('a, 'b) Either.t option -> 'a option
val filter_right : ('a, 'b) Either.t option -> 'b option
val iter : ('a -> unit) -> 'a option -> unit
val iter_s : ('a -> unit Lwt.t) -> 'a option -> unit Lwt.t
val iter_e : ('a -> (unit, 'trace) result) -> 'a option -> (unit, 'trace) result
val iter_es : ('a -> (unit, 'trace) result Lwt.t) -> 'a option -> (unit, 'trace) result Lwt.t
val is_none : 'a option -> bool
val is_some : 'a option -> bool
val equal : ('a -> 'a -> bool) -> 'a option -> 'a option -> bool
val compare : ('a -> 'a -> int) -> 'a option -> 'a option -> int
val to_result : none:'trace -> 'a option -> ('a, 'trace) result
val of_result : ('a, 'e) result -> 'a option
val to_list : 'a option -> 'a list
val to_seq : 'a option -> 'a Seq.t
val catch : ?catch_only:(exn -> bool) -> (unit -> 'a) -> 'a option
val catch_o : ?catch_only:(exn -> bool) -> (unit -> 'a option) -> 'a option
val catch_s : ?catch_only:(exn -> bool) -> (unit -> 'a Lwt.t) -> 'a option Lwt.t
val catch_os : ?catch_only:(exn -> bool) -> (unit -> 'a option Lwt.t) -> 'a option Lwt.t
OCaml

Innovation. Community. Security.