The scanner for the adjacent elements.
The scanned list.
import { fromArray, scanL, toArray } from "./list.ts";
import { assertEquals } from "../deps.ts";
const aList = fromArray([1, 2, 2, 4, 4, 3]);
const partialSum = scanL((a: number) => (b: number) => a + b)(0)(aList);
assertEquals(toArray(partialSum), [0, 1, 3, 5, 9, 13, 16]);
Generated using TypeDoc
Scans the list from left. It is useful to make the partial sum list.