Bare_structs.Seq_einclude Bare_sigs.Seq_e.Stype ('a, 'e) t = unit -> (('a, 'e) node, 'e) Stdlib.resultinclude Seqes.Sigs.SEQMON2ALL
with type ('a, 'e) mon := ('a, 'e) Stdlib.result
with type ('a, 'e) t := ('a, 'e) tval iter : ('a -> unit) -> ('a, 'e) t -> (unit, 'e) Stdlib.resultval fold_left : ('a -> 'b -> 'a) -> 'a -> ('b, 'e) t -> ('a, 'e) Stdlib.resultval iteri : (int -> 'a -> unit) -> ('a, 'e) t -> (unit, 'e) Stdlib.resultval fold_lefti :
('b -> int -> 'a -> 'b) ->
'b ->
('a, 'e) t ->
('b, 'e) Stdlib.resultval for_all : ('a -> bool) -> ('a, 'e) t -> (bool, 'e) Stdlib.resultval exists : ('a -> bool) -> ('a, 'e) t -> (bool, 'e) Stdlib.resultval find : ('a -> bool) -> ('a, 'e) t -> ('a option, 'e) Stdlib.resultval find_map : ('a -> 'b option) -> ('a, 'e) t -> ('b option, 'e) Stdlib.resultval init : int -> (int -> 'a) -> ('a, 'e) tval unfold : ('b -> ('a * 'b) option) -> 'b -> ('a, 'e) tval forever : (unit -> 'a) -> ('a, 'e) tval iterate : ('a -> 'a) -> 'a -> ('a, 'e) tval is_empty : ('a, 'e) t -> (bool, 'e) Stdlib.resultval length : ('a, 'e) t -> (int, 'e) Stdlib.resultval empty : ('a, 'e) tval return : 'a -> ('a, 'e) tval repeat : 'a -> ('a, 'e) tval of_dispenser : (unit -> ('a option, 'e) Stdlib.result) -> ('a, 'e) tval to_dispenser : ('a, 'e) t -> unit -> ('a option, 'e) Stdlib.resultval ints : int -> (int, 'e) tval of_seq : 'a Stdlib.Seq.t -> ('a, 'e) tval return_e : ('a, 'e) Stdlib.result -> ('a, 'e) treturn_e (Ok x) is a whole sequence containing the single element x. return_e (Error e) is a sequence immediately interrupted by the error e.
val interrupted : 'e -> ('a, 'e) tinterrupted e is a sequence immediately interrupted by the error e.
map_error f seq is a sequence feq.
seq is a whole sequence, then feq is the same whole sequence.seq is an interrupted sequence, then feq is a sequence interrupted by Error (f e) where the elements of the successful prefix are the elements of the successful prefix of seq.val iter_p : ('a -> unit Lwt.t) -> ('a, 'e) t -> (unit, 'e) Stdlib.result Lwt.titer_p f seq is a promise p.
seq is a whole sequence, then p resolves to Ok () once all the promises created by f on the elements of seq have resolved.seq is interrupted by Error e, then p resolves to Error e once all the promises created by f on the elements of the successful prefix of seq have resolved.Note that the behaviour for interrupted sequences is in line with the best-effort semantic of Lwtreslib.
cons_e (Ok x) s is the sequence containing x followed by s. It is a whole sequence if s is.
cons_e (Error e) s is a sequence immediately interrupted by e.
val of_seq_catch : 'a Stdlib.Seq.t -> ('a, exn) tof_seq_catch s is a sequence with the same elements as s which is interrupted when forcing an element of the sequence raises an exception.
val of_seq_once : when_forced_twice:'e -> 'a Stdlib.Seq.t -> ('a, 'e) tof_seq_once ~when_forced_twice s is a sequence with the same elements as s which is interrupted when an element of the sequence is forced twice.
In other words, it is equivalent to
map_error
(function Seq.Forced_twice -> when_forced_twice | e -> raise e)
(of_seq_catch (Seq.once s))val of_seq_e : ('a, 'e) Stdlib.result Stdlib.Seq.t -> ('a, 'e) t