Deferred.Or_errortype 'a t = 'a Core.Or_error.t tinclude Core.Monad.S with type 'a t := 'a tval return : 'a 'i 'p 'q. 'a -> 'a tConvert a value to a t.
Sequences computations. bind t ~f computes f v for value(s) v in t. Well-behaved monads satisfy these "laws" (where ( >>= ) is the infix bind operator):
map t ~f is equivalent to bind t ~f:(fun x -> return (f x))return x >>= f is equivalent to f xt >>= return is equivalent to t(t >>= f) >>= g is equivalent to t >>= fun x -> f x >>= gCombines nested t into just one layer. Equivalent to bind t ~f:Fn.id.
Ignores contained values of t. Equivalent to map t ~f:ignore.
module Monad_infix : sig ... endmodule Let_syntax : sig ... endval fail : Core.Error.t -> _ tval ok_unit : unit tval of_exn : ?backtrace:[ `Get | `This of string ] -> exn -> _ tval of_exn_result :
?backtrace:[ `Get | `This of string ] ->
('a, exn) Core.Result.t t ->
'a tval error : string -> 'a -> ('a -> Core.Sexp.t) -> _ tval error_s : Core.Sexp.t -> _ tval error_string : string -> _ tval errorf : ('a, unit, string, _ t) Core.format4 -> 'aval tag_s : 'a t -> tag:Core.Sexp.t -> 'a tval tag_s_lazy : 'a t -> tag:Core.Sexp.t Core.Lazy.t -> 'a tval tag_arg : 'a t -> string -> 'b -> ('b -> Core.Sexp.t) -> 'a tval unimplemented : string -> _ tval try_with :
?extract_exn:bool ->
?run:[ `Now | `Schedule ] ->
?rest:[ `Log | `Raise | `Call of exn -> unit ] ->
here:lexing_position ->
?name:string ->
(unit -> 'a t) ->
'a tNote that try_with f is eager only in the Ok case.
val try_with_join :
?extract_exn:bool ->
?run:[ `Now | `Schedule ] ->
?rest:[ `Log | `Raise | `Call of exn -> unit ] ->
here:lexing_position ->
?name:string ->
(unit -> 'a t) ->
'a tNote that try_with_join f is eager only when no exception is raised by f.
module Array :
Async_kernel.Monad_sequence.S
with type 'a monad := 'a t
with type 'a t := 'a arraymodule Iarray :
Async_kernel.Monad_sequence.S
with type 'a monad := 'a t
with type 'a t := 'a iarraymodule List :
Async_kernel.Monad_sequence.S
with type 'a monad := 'a t
with type 'a t := 'a list