Creates a memoized version of the receiver function.
A function that caches results for previously used inputs.
The input type for the function.
The output type of the function.