Pure Function
/pjʊər ˈfʌŋkʃən/pure func·tionnoun
Definition
1.[in functional programming] a routine whose result is determined entirely by its arguments and which changes nothing outside itself, so calling it twice with the same input is indistinguishable from calling it once.
Because it is a pure function, the result can be cached indefinitely.
Etymology
From pure, Latin purus 'unmixed', in the sense of free of side effects. The concept comes from mathematical functions and reached programming through the functional languages of the 1970s and 80s.
Synonyms
- referentially transparent functionsense 1 · Absolute
Antonyms
- side-effecting functionsense 1 · Complementary
See also
References
- Hughes, J. (1989). Why Functional Programming Matters.The Computer Journal, 32(2), 98–107.