7 ms·
So, in Haskell, each function is pure. If you want to modify the state of the world, you thread the world through your function. Just as a thought, it'd be in
by lsb 18y ago
So, in Haskell, each function is pure. If you want to modify the state of the world, you thread the world through your function.
Just as a thought, it'd be interesting to see if Haskell could use a memcached backend to memoize the values of old function calls.
- mooism2 18y agoAh, you mean programs compiled by ghc, not ghc itself. It shouldn't be too difficult to write a `memo` function that memoises its argument using `unsafePerformIO` and memcached. There's no need to modify ghc.