beyond memoization you can do cool stuff with scheduling if you annotate pure functions and execute lazily. I actually mocked this up a little while back https://github.com/bwasti/lazy
also just shared it here https://news.ycombinator.com/item?id=18080598 if you have comments