2 ms·
It isn't just IO that breaks referential transparency, State does the same thing. The function get might have different values at different times. Of course, g
by yummyfajitas 17y ago
It isn't just IO that breaks referential transparency, State does the same thing. The function get might have different values at different times.
Of course, get is a pure function mapping (State a) -> (State a) a, and the value hidden in the state is different between successive function calls.
Now just treat IO as State World, and think of the compiler as the function execState initialWorldValue.