Module IStream
Purely functional streams
Contrarily to OCaml module Stream, these are meant to be used purely functionally. This implies in particular that accessing an element does not discard it.
type 'a node=|Nil|Cons of 'a * 'a tView type to decompose and build streams.
Constructors
val empty : 'a tThe empty stream.
Destructors
val is_empty : 'a t -> boolWhethere a stream is empty.
Standard operations
All stream-returning functions are lazy. The other ones are eager.
val iter : ('a -> unit) -> 'a t -> unitIteration over streams.
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'aFold over streams.
Conversions
val of_list : 'a list -> 'a tConvert a list into a stream.
val to_list : 'a t -> 'a listConvert a stream into a list.