We know that pure functions:
- Always return the same result for a given input
- Produce no side-effects
This leads us to referential transparency - where an expression can be replaced with a value without changing the behaviour of the program.
This tells us that a program can be said to be purely functional if it excludes destructive modifications (updates) of entities in the program's running environment.
This commentator wrote:
grappling with what "pure" in an FP setting actually means, considering application itself is a protocol for mutation (the stack)
My question is: What does 'pure' in functional programming mean if an application mutates the stack?