While working on the paper „Evolution of Functional UI Paradigms“,
published at the FUNARCH workshop of ICFP
2025, I had
a thought about pure functions that I would like to briefly explain
here. As an argument in favor of pure functions, functional
programmers often cite better testability: pure functions require no
complicated test setup or mocks, are deterministic, parallelizable,
etc. In tendency, this is certainly correct. Pure functions are often
better suited for testing than their impure counterparts. However,
this connection is not a neccessary implication in either direction:
There are pure functions that are hard to test, and there are impure
functions that are easy to test. Thus purity itself cannot be the
substance that ensures a piece of program is properly testable. But
then what is this substance?
Read on...