first s resolves to None if s is empty (and its suspended node resolves), it resolves to Some x where x is the first element of s, it does not resolve if the promised node of s doesn't.
Note that first forces the first element of the sequence, which can have side-effects or be computationally expensive. Consider, e.g., the case where s = filter (fun …) s': first s can force multiple of the values from s'.
Similar to fold_left but applies to Lwt-suspended sequences. Because the nodes are suspended in promises, traversing may yield and, consequently, the function fold_left returns a promise.
val fold_left_e :
('a->'b->('a, 'trace)Stdlib.result)->'a->'bt->('a, 'trace)Stdlib.resultLwt.t
Similar to fold_left but wraps the traversal in Result. The traversal is interrupted if one of the step returns an Error _.
val fold_left_s : ('a->'b->'aLwt.t)->'a->'bt->'aLwt.t
Similar to fold_left but the folder is within Lwt.
val fold_left_es :
('a->'b->('a, 'trace)Stdlib.resultLwt.t)->'a->'bt->('a, 'trace)Stdlib.resultLwt.t
Similar to fold_left but the folder is within result-Lwt. Traversal is interrupted if one of the step resolves to an Error _.
Similar to iter but wraps the iteration in Lwt. Each step of the iteration is started after the previous one is resolved.
val iter_es :
('a->(unit, 'trace)Stdlib.resultLwt.t)->'at->(unit, 'trace)Stdlib.resultLwt.t
Similar to iter but wraps the iteration in result Lwt.t. Each step of the iteration is started after the previous one resolved. The iteration is interrupted if one of the promise is rejected of fulfilled with an Error _.
val iter_ep :
('a->(unit, 'trace)Stdlib.resultLwt.t)->'at->(unit, 'trace list)Stdlib.resultLwt.t
Similar to iter but wraps the iteration in result Lwt.t. The steps of the iteration are started concurrently: one iteration starts as soon as a node becomes resolved. The promise iter_ep resolves once all the promises of the traversal resolve. At this point it either:
is rejected if at least one of the promises is, otherwise
is fulfilled with Error _ if at least one of the promises is, otherwise
Similar to iter but wraps the iteration in Lwt. The steps of the iteration are started concurrently: one iteration is started as soon as the node becomes resolved. The promise iter_p f s is resolved only once all the promises of the iteration are. At this point it is either fulfilled if all promises are, or rejected if at least one of them is.
Similar to filter but wraps the transformation in Lwt.t. Each test of the predicate is done sequentially, only starting once the previous one has resolved.