chickadee » library » foldl

foldl PROCEDURE INIT LISTprocedure

Applies PROCEDURE to the elements from LIST, beginning from the left:

(foldl + 0 '(1 2 3))    ==>    (+ (+ (+ 0 1) 2) 3)

Note that the order of arguments taken by PROCEDURE is different from the SRFI-1 fold procedure, but matches the more natural order used in Haskell and Objective Caml.