memoize

Memoize from _real world functional programming_ by Petricek and Skeet chapter 10 tutorial