memoize, memoize_rec decorators.