package spotlib
Module Spotlib.SpotStreamSource
Lazy list or Stream
Type
Constructors
Deconstructors
Conversions between the eager list
Conversion from a lazy stream to a strict list. Do not use against inifinite streams.
Conversion from a strict list to a lazy stream. The conversion itself is done strictly: the result has no reference to the original list
Misc functions
fold_left1 f (x^^xs) = fold_left f x xs fold_left1 f null raises an exception.
Folding left, strict version. Never terminates over inifinite streams. Tail recursive.
fold_right f t init. Folding right. Not tail recursive. If laziness is required, it is the responsibility of f.
fold_right1 f (append xs (singleton x)) = fold_right f xs x fold_right1 f null raises an exception. If laziness is required, it is the responsibility of f.
Inpure hacks
Get elements between two points of the *same* stream.
The first argument of rev_between and between must point the former element of the stream than the second argument. Otherwise, the behaviour of rev_between and between are not specified: a wrong result or memory exhaustion by an infinite loop.