Module Async_extended.Any_error

type ('ok, 'err) t = ('ok'errAsync.Deferred.Result.t

A variant of Deferred.Result.t with "any error" semantics. When multiple deferred values that each may be an error are combined, the result may fail with any of the component errors, instead of deterministically choosing a particular one. This enables the result to become determined sooner: for example, Deferred.Or_error.all gives the "leftmost" error if any, so if only the last element of the list is an error, the result will still not be determined until every other element has become so. By contrast, Any_error.all ts may become determined with an error as soon as any element of ts becomes determined with an error.

Note that there is no monad interface, since in a monadic bind, whether or not later deferreds become errors may depend on the value of earlier ones, so "any-error" doesn't make sense in that context. However, the equivalence with Deferred.Result.t is exposed, so you can just use that monad interface where necessary.

include Core.Applicative.S2 with type (ok, err) t := (ok, err) t
type ('a, 'e) t
val return : 'a ‑> ('a_t
val apply : ('a ‑> 'b'et ‑> ('a'et ‑> ('b'et
val map : ('a'et ‑> f:('a ‑> 'b) ‑> ('b'et
val map2 : ('a'et ‑> ('b'et ‑> f:('a ‑> 'b ‑> 'c) ‑> ('c'et
val map3 : ('a'et ‑> ('b'et ‑> ('c'et ‑> f:('a ‑> 'b ‑> 'c ‑> 'd) ‑> ('d'et
val all : ('a'et list ‑> ('a list, 'et
val all_unit : (unit, 'et list ‑> (unit, 'et
val all_ignore : (unit, 'et list ‑> (unit, 'et
  • Deprecated [since 2018-02] Use [all_unit]
val both : ('a'et ‑> ('b'et ‑> ('a * 'b'et
module Applicative_infix : sig ... end
include module type of Applicative_infix
val (<*>) : ('a ‑> 'b'et ‑> ('a'et ‑> ('b'et
val (<*) : ('a'et ‑> (unit, 'et ‑> ('a'et
val (*>) : (unit, 'et ‑> ('a'et ‑> ('a'et
val all_unit : (unit, 'errt list ‑> (unit, 'errt