Skip to content
Ville Rissanen edited this page Sep 20, 2021 · 1 revision

foldl(folder, foldable, ?intial)

  • folder - bifunction that produces a single result.
  • foldable - iterable var, usually a list.
  • ?initial - initial value for folding, defaults to var().

Left fold an iterable var value, usually a list.

Examples

let iterable = {1, 2, 3};
let folded = foldl([]lambda(st + nd), iterable) // 6.

Clone this wiki locally