Functional Programming

Functional programming is a highly developed and deeply integrated core feature of the Wolfram Language, made dramatically richer and more convenient through the symbolic nature of the language. Treating expressions like as both symbolic data and the application of a function f provides a uniquely powerful way to integrate structure and functionand an efficient, elegant representation of many common computations.


Function (&) specify a pure function (e.g. )

#, ##, #name slots for variables in a pure function

Applying Functions to Lists »

Map (/@) map across a list:

Apply (@@, @@@) apply to a list:

MapIndexed map with index information:

MapThread  ▪  MapAt  ▪  MapAll  ▪  Scan  ▪  ...

Iteratively Applying Functions »

Nest, NestList, NestGraph nest a function: etc.

Fold, FoldList fold in a list of values: etc.

SequenceFold  ▪  SequenceFoldList  ▪  FoldPair  ▪  FoldPairList

FixedPoint, FixedPointList repeatedly nest until a fixed point

NestWhile  ▪  NestWhileList  ▪  TakeWhile  ▪  LengthWhile  ▪  ...

List-Oriented Functions »

Select select from a list according to a function

Array create an array from a function

SortBy  ▪  MaximalBy  ▪  SplitBy  ▪  GatherBy  ▪  ...

Association-Oriented Functions

AssociationMap create an association from a function

KeySortBy  ▪  CountsBy  ▪  GroupBy  ▪  ...

Functional Composition

Identity  ▪  Composition  ▪  Operate  ▪  Through  ▪  Distribute  ▪  ...

"Curried" Operator Forms

Select  ▪  Cases  ▪  Append  ▪  Map  ▪  Position  ▪  ...

Translate this page: