Cache the results of a function so that when you call it again with the same arguments it returns the pre-computed value.
This version of memoise can be found in the following snapshots: