package octez-libs
The S
signature is similar to Seq.S
except that suspended nodes are wrapped in a promise.
This allows some additional traversors to be applied lazily.
The functions of_seq
and of_seq_s
allow conversion from vanilla sequences.
include Bare_sigs.Seq_s.S
with type 'a node = 'a Bare_structs.Seq_s.node
and type 'a t = 'a Bare_structs.Seq_s.t
This is similar to S.t
but the suspended node is a promise.
and 'a t = 'a Bare_structs.Seq_s.t
include Seqes.Sigs.SEQMON1ALL
with type 'a mon := 'a Lwt.t
with type 'a t := 'a t
val init : int -> (int -> 'a) -> 'a t
val unfold : ('b -> ('a * 'b) option) -> 'b -> 'a t
val forever : (unit -> 'a) -> 'a t
val iterate : ('a -> 'a) -> 'a -> 'a t
val empty : 'a t
val return : 'a -> 'a t
val repeat : 'a -> 'a t
val ints : int -> int t
return_s p
is a sequence with the value the promise p
resolves to as its single element.
cons_s p s
is the sequence containing the value the promise p
resolves to, followed by s
.
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.
'error trace
is intended to be substituted by a type provided by a Trace
module (with type 'error trace := 'error Trace.trace
)
val iter_ep :
('a -> (unit, 'error trace) result Lwt.t) ->
'a t ->
(unit, 'error trace) result Lwt.t
Similar to iter
but wraps the iteration in result Lwt.t
. All the steps of the iteration are started concurrently. The promise iter_ep
resolves once all the promises of the traversal resolve. At this point it is either:
- rejected if at least one of the promises is, or
- fulfilled with
Error _
if at least one of the promises is, or - fulfilled with
Ok ()
if all the promises are.