oseq

Simple list of suspensions, as a composable lazy iterator that behaves like a value
IN THIS PACKAGE
Module OSeq . Generator
type 'a t

Type for writing generators (of type 'a OSeq.Generator.t) that can be used to construct an iterator of type 'a OSeq.t

val empty : 'a t

Empty generator, yields no value

val yield : 'a -> 'a t

Yield one value

val (>>=) : 'a t -> ( unit -> 'a t ) -> 'a t

gen1 >>= fun () -> gen2 first yields all values from gen1, and then all values from gen2

val delay : ( unit -> 'a t ) -> 'a t

Delayed generator, will evaluate the function when needed

val run : 'a t -> 'a seq

Iterator over the values yielded by the generator