Then you simply discipline yourself to only memoiz...
# random
f
Then you simply discipline yourself to only memoize functions you know to be pure.