memoize
Returns a function that caches every result of fn by argument.
The cache is unbounded and lives as long as the returned function. Each distinct argument invokes fn once; later calls return the cached result, including a cached null. Arguments are compared by Any.equals and Any.hashCode. The returned function is not thread-safe.
Type Parameters
the argument type.
the result type.
Returns a function that caches every result of fn by argument pair.
The cache is unbounded and lives as long as the returned function. Each distinct pair of arguments invokes fn once; later calls return the cached result, including a cached null. Arguments are compared by Any.equals and Any.hashCode. The returned function is not thread-safe.
Type Parameters
the first argument type.
the second argument type.
the result type.