Module Async.Std.Deferred.List

module List: sig .. end


Provides asynchronous variants of the standard List module functions
val fold : 'a list ->
'b -> ('b -> 'a -> 'b Deferred.t) -> 'b Deferred.t
fold an asynchronous function over a list
val find : 'a list ->
('a -> bool Deferred.t) -> 'a option Deferred.t
find the first element of a list satisfying an asynchronous predicate. returns None if no element exists.

map, iter, and filter (below) use two new features of OCaml that you haven't seen before: optional arguments and polymorphic variants. For more information on these types, see the recitation 18 notes.
val map : ?how:[ `Parallel | `Sequential ] ->
'a list -> ('a -> 'b Deferred.t) -> 'b list Deferred.t
map an asynchronous function over a list; map l f becomes determined when all calls to f complete.

If how is `Parallel, all of the calls to f will be started immediately. If how is `Sequential, the second call to f will only start when the first completes, and so on.

The default how is `Sequential

val iter : ?how:[ `Parallel | `Sequential ] ->
'a list -> ('a -> unit Deferred.t) -> unit Deferred.t
iterate an asynchronous unit-valued function over a list; iter l f becomes determined only after all calls to f complete.
val filter : ?how:[ `Parallel | `Sequential ] ->
'a list -> ('a -> bool Deferred.t) -> 'a list Deferred.t
filter a list using an asynchronous predicate