Lazy List
Used for iterating lazily over a stream (possibly infinite). The point of using 'a lazy_t for the tail is that once a list node is forced (evaluated), it is memoized and will not be re-computed if accessed again. This is important for lazy lists of elements that are expensive to compute.
Sourcetype 'a node = | Nil| Cons of 'a * 'a t
Sourceval of_fun : (int -> 'a option) -> 'a t Sourceval to_list : 'a t -> 'a list Gather all values into a list
Sourceval fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a