arliss_obsidian/fp/Terminology/Referential Transparency.md
Orion Kindel 3701b1e2f8
update
2024-09-23 18:56:55 -05:00

13 lines
356 B
Markdown

A property of [[Purity|pure]] [[Functions|functions]] that they can always be replaced by the expression they return.
For example `add` is referentially transparent, so
```haskell
a = add 1 3
```
could be replaced with
```haskell
a = 4
```
at design- or compile-time, because `add` always returns the same result and performs no observable side-effects.