A pure function is a function in the mathematical sense: its result is determined entirely by its arguments, and computing it produces no observable side effects. It does not read or write external state, perform input or output, or mutate its inputs. Given the same arguments, it always returns the same value. The Haskell site describes exactly this property when it says that “every function in Haskell is a function in the mathematical sense (i.e., ‘pure’).”
This restriction is the core building block of functional programming. Because a pure function cannot interfere with the rest of the program except through its return value, expressions built from pure functions are referentially transparent: a call can be replaced by its result without changing the program’s meaning. The absence of side effects is also what John Hughes, in “Why Functional Programming Matters,” points to as making functional programs easier to reason about and combine.
Purity brings several practical benefits. A pure function is deterministic and therefore easy to test, since its behavior depends on nothing but the arguments handed to it. Its results can be cached, because the same inputs will always produce the same output. And independent calls can be evaluated in any order or in parallel, because none of them can affect one another through shared state.
The obvious tension is that real programs must eventually do impure things such as reading files or printing output. Languages built around purity resolve this by representing those effects explicitly rather than letting any function perform them silently; in Haskell, for instance, input and output are handled through a dedicated monadic I/O system that keeps the rest of the code pure.