Memoization monad transformer