memoize

fun <T, R> (T) -> R.memoize(): (T) -> R

Creates a memoized version of the receiver function.

Return

A function that caches results for previously used inputs.

Parameters

T

The input type for the function.

R

The output type of the function.