Comparison of programming languages (functional programming)

From Wikipedia, the free encyclopedia
Jump to: navigation, search

This page provides the comparison tables of functional programming instructions between programming languages. Comparison of basic instructions of imperative paradigm is provided by the comparison of basic instructions.

List operations[edit]

Function applications and lists[edit]

map apply identity lambda lambda filter fold sum
Python map(func, list) func(*arguments) lambda x: x lambda x: ... filter(func, list) functools.reduce(func, list) sum(list)
Mathematica Map[func, list] or func /@ list Apply[func, args] or func @@ args #& ... # ... & Select[list, func] Fold[func, initval, list] Plus

Numerical operations on lists[edit]

sort max min
Python sorted(...) max(...) min(...)
Mathematica Sort[...] Max[...] Min[...]

Iterations on lists[edit]

group by
Python itertools.groupby(list, func)
Mathematica GroupBy[list, func][1]

Generating lists by combinatorics tools[edit]

Generate range (lazily) Infinite range (lazily)
Python xrange(start, end) itertools.count(start, step)

References[edit]