A lot of discussion about “purity” goes on without participants necessarily having a clear idea of what it means exactly. Such discussion is generally unhelpful and distracting.
What purity is
The typical definition of purity (and the one we use in our book) goes something like this:
An expression e is referentially transparent if for all programs p, every occurrence of e in p can be replaced with the result of evaluating e without changing the result of evaluating p.
A function f is pure if the...
Published on February 15, 2015 01:58