Deferred.Or_errorinclude module type of struct include Async_kernel.Deferred.Or_error endmodule Deferred = Async_kernel.Deferred.Or_error.Deferredtype 'a t = 'a Core.Or_error.t Async_kernel.Deferred.tThe applicative operations match the behavior of the applicative operations in Or_error. This means that all and all_unit are equivalent to combine_errors and combine_errors_unit respectively.
include Core.Applicative.S with type 'a t := 'a tmodule Applicative_infix = Async_kernel.Deferred.Or_error.Applicative_infixreturn x = Deferred.return (Ok x) *
include Core.Monad.S with type 'a t := 'a tmodule Monad_infix = Async_kernel.Deferred.Or_error.Monad_infixval return : 'a -> 'a tmodule Let_syntax = Async_kernel.Deferred.Or_error.Let_syntaxval fail : Core.Error.t -> _ tfail error = Deferred.return (Error error) *
val ok_exn : 'a t -> 'a Async_kernel.Deferred.tThese functions are direct analogs of the corresponding Core.Or_error functions.
val of_exn : exn -> _ tval of_exn_result : ('a, exn) Core.Result.t Async_kernel.Deferred.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 -> _ tfind_map_ok l ~f returns the first value in l for which f returns Ok, otherwise it returns the same error as combine_errors (Deferred.List.map l ~f).
val ok_unit : unit tok_unit = return ()
val try_with :
?extract_exn:bool ->
?run:[ `Now | `Schedule ] ->
?rest:[ `Log | `Raise | `Call of exn -> unit ] ->
?here:Lexing.position ->
?name:string ->
(unit -> 'a Async_kernel.Deferred.t) ->
'a ttry_with f catches exceptions thrown by f and returns them in the Result.t as an Error.t. try_with_join is like try_with, except that f can throw exceptions or return an Error directly, without ending up with a nested error; it is equivalent to try_with f >>| Result.join.
The option extract_exn is passed along to Monitor.try_with ?extract_exn and specifies whether or not the monitor exn wrapper should be skipped (extract_exn:true or kept (extract_exn:false).
The ~rest argument controls how exceptions are handled after the try_with deferred becomes determined. They may be logged, raised, or passed to a callback.
The ~run argument controls when f gets called. `Now calls f immediately; `Schedule schedules an asynchronous job to run f.
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 tmodule List = Async_kernel.Deferred.Or_error.ListAll of the List functions that take a how argument treat it the following way:
val repeat_until_finished :
'state ->
('state -> [ `Repeat of 'state | `Finished of 'result ] t) ->
'result trepeat_until_finished initial_state f works just like Deferred.repeat_until_finished but with the Deferred.Or_error monad. If f returns an Or_error.Error the loop terminates and returns.
module Expect_test_config : sig ... end