export type Stream = Iterable & ({ type: 'nil'; } | { type: 'cons'; head: T; tail: () => Stream; }); export declare function cons(head: T, tail: () => Stream): Stream; export declare function singleton(value: T): Stream; export declare function map(fn: (a: A) => B, stream: Stream): Stream; export declare function interleave(stream1: Stream, stream2: Stream): Stream; export declare function concat(streams: Stream>): Stream; export declare function diagonalize(pair: (a: A, b: B) => C, streamA: Stream, streamB: Stream): Stream; export declare function take(n: number, stream: Stream): Stream; export declare function takeWhile(predicate: (_: A) => boolean, stream: Stream): Stream; export declare function fromArray(array: Array): Stream; export declare function range(start: number, end: number): Stream;