3 ms·
If you throw the result away in pure code then you may as well have never computed it: the second result holds only. In an impure setting none of the math abov
by tel 12y ago
If you throw the result away in pure code then you may as well have never computed it: the second result holds only.
In an impure setting none of the math above holds.
Edit: note that this doesn't mean you have to throw away local or global state. You can recapture that by using state machine transformers or even Kleisli state machine transformers (although that gets pretty heavy!)
- moomin 12y agoAaah. Makes sense. I couldn't figure out why the reasoning seemed sound, but I had something that didn't match. It's because in Clojure, r has state itself.