A fold (from the left) is a higher-order relation between:
For example: Use foldl/4 to express the sum of all elements in a list, using a predicate as a building block to define the sum of two elements:
?- foldl(plus, [2,3,4], 0, S).
S = 9.
Get monthly updates about new articles, cheatsheets, and tricks.