Pure memoization combinators for Haskell