Haskell has memcached bindings; maybe GHC could memoize directly to memcached? (hackage.haskell.org) 4 points by lsb 17y ago ↗ HN
[–] mooism2 17y ago ↗ Ghc could memoize what to memcached?Is there some context I'm missing? I feel like I'm coming in half-way through a conversation. [–] lsb 17y 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 17y ago ↗ Ah, 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.
[–] lsb 17y 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 17y ago ↗ Ah, 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.
[–] mooism2 17y ago ↗ Ah, 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.
3 comments
[ 42.4 ms ] story [ 1060 ms ] threadIs there some context I'm missing? I feel like I'm coming in half-way through a conversation.
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.
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.