scan
import { scan } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/iterable.ts";Create an Iterable that yields accumulated values from a fold operation.
@example
import * as I from "./iterable.ts";
const numbers = I.wrap(1, 2, 3, 4, 5);
const runningSum = I.scan((acc: number, n: number) => acc + n, 0)(numbers);
const result = Array.from(runningSum); // [1, 3, 6, 10, 15]
function scan<A, O>(foldr: (
accumulator: O,
value: A,
index: number,
) => O, initial: O): (ta: Iterable<A>) => Iterable<O>;