In functional programming, fold or "reduce" is a kind of higher-order function that takes as arguments a function, an initial "accumulator" value and a data structure (often a list).