query
On this page

foldr

lib.foldr

Docs pulled from | This Revision | 10 minutes ago


fold is an alias of foldr for historic reasons

(lib.lists.fold)

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

foldr =
    op: nul: list:
    let
      len = length list;
      fold' = n: if n == len then nul else op (elemAt list n) (fold' (n + 1));
    in
    fold' 0;