Functional Programming - Reduce - Reduction Operation (fold)

> Code - (Programming|Computer) Language > Code - Functional programming (FP) - Collection Operations

1 - About

A (reduction|reduce) operation (also called a fold) is a functional programming function.

It takes a sequence of input elements and combines them into a single summary result by repeated application of a combining operation, such as:

  • finding the sum or maximum of a set of numbers,
  • accumulating elements into a list (collections)
  • summarizing elements according to various criteria
  • etc..
Advertising

3 - Property

3.1 - Batch

A reduction operates on the stream as a whole rather than on individual elements. See Data Processing - Batch

3.2 - Parallel

A properly constructed reduce operation is inherently parallelizable. See Parallel Programming - (Function|Operation)

4 - Documentation / Reference

code/fp/reduce.txt · Last modified: 2018/10/10 10:07 by gerardnico