It is extremely powerful and could be used
to reimplement most of the functions in this module.fold(f, [x0, x1, x2, ..., init)] will computef(... f(x2, f(x1, f(x0, init))) ...)Example: the following expression computes
the sum of all elements of a list fold(_+_, l, 0).Example: the following expression computes
the length of a list fold((_,i -> i+1), l, 0)
list to update the data.
will also be the result.