memoize

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