Optimize program performance by converting a heavily-used function into a data structure.
Converts a function into a data structure, and outputs a new function that uses that data structure instead of the old function. Sometimes useful for enhancing program performance.
Note: The new function will agree with the old function only on
the domain provided in the MemoizeStrategy. Outside of that domain,
the new function will return the default provided in the MemoizeStrategy.
A strategy for turning a function into data structure.
Note: You should define any
MemoizeStrategys at the top-level of a file so that you're guaranteed to neven recompute the domain.