Skip to main content

For questions about functions that give identical outputs for identical inputs between separate calls and do not have any program-visible side effects.

In order for a function to be considered a 'pure' function, the following has to be true:

  • The output depends solely on the (unchanging) contents of the function and the input values. This means that the same output will always occur for any given input.
  • The function has no program visible side-effects, such as modifications of global states, or I/O.

See also: