Deferred.Resultinclude Core.Monad.S2
with type ('a, 'b) t = ('a, 'b) Core.Result.t Async_kernel.Deferred.ttype ('a, 'b) t = ('a, 'b) Core.Result.t Async_kernel.Deferred.tval return : 'a 'i 'p 'q. 'a -> ('a, 'p) tConvert a value to a t.
Transforms the contents of 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.
Combines a list of t whose contents are unimportant.
module Monad_infix : sig ... endmodule Let_syntax : sig ... endval fail : 'err -> (_, 'err) tval failf : ('a, unit, string, (_, string) t) Core.format4 -> 'ae.g., failf "Couldn't find bloogle %s" (Bloogle.to_string b).
val combine :
('ok1, 'err) t ->
('ok2, 'err) t ->
ok:('ok1 -> 'ok2 -> 'ok3) ->
err:('err -> 'err -> 'err) ->
('ok3, 'err) tcombine waits on both inputs and combines their results using Result.combine.
module List :
Async_kernel.Monad_sequence.S2_result
with type ('a, 'e) monad := ('a, 'e) t
with type 'a t := 'a list