foldl(function(tuple(A, A), A) op, list(A) alist) applies a binary function to the elements of a list beginning from the list. If alist is empty an exception of type value.empty is raised. If alist just contains one element that element is returned. Otherwise the first and second element are converted by op to a value n1. The value n1 and the third element are converted to n2 and so on.
foldl(function(tuple(A, A), A) op, list(A) alist, neutral) is a variant of fold that takes a third element neutral. That element is returned if alist is empty. Otherwise This variant behaves exactly like the binary version of foldl. Note: Some operations as + and * have natural neutral elements such as 0 or 1 resp. Other operations like max do not have a neutral element that makes any sense: What is the maximum element of an empty list?
foldl(lambda x,y: x+y, [1,2,3,4]) == 10 foldl(max, [1,3,2,5]) == 5
