forked from orion/obsidian
13 lines
356 B
Markdown
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.
|