memoize With Limit
Creates a size-limited memoized version of the receiver function.
Receiver
The function to be memoized.
Return
A function that caches results for previously used inputs, with a size limit.
Parameters
T
The input type for the function.
R
The output type of the function.
max Size
The maximum number of entries to keep in the cache.