referentiallytransparentfunction
nounA function that always gives the same answer for the same input and does nothing else.
Because the function only adds two numbers and never changes anything outside itself, it is a referentially transparent function.
OTHER MEANINGS
2. A function whose calls can be replaced by their results without changing the program's behavior.
The compiler optimized the code by substituting the referentially transparent function's output directly.
3. A function that does not read or write mutable state, making it safe to evaluate in any order.
Parallelizing the loop was easy because each referentially transparent function call was independent.
4. A function that returns the same value every time it is called with the same arguments, regardless of when or where it runs.
Caching worked perfectly since the referentially transparent function never depended on the clock.