Functional Programming - Reduce - Reduction Operation (fold)


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

Reduction operations are terminal operations.

They takes a sequence of input elements and returns:

  • a single summary result
  • a collection
  • or a map


  • finding the sum or maximum of a set of numbers,
  • finding the average of values
  • grouping elements into categories
  • accumulating elements into a list (collections) - group by, partitioningBy
  • summarizing elements according to various criteria
  • etc..



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


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

Documentation / Reference

Powered by ComboStrap