What would be the best way to cache the result of an extension function? Ideally I'd create an extension field on the class to cache the result but this isn't possible. I'm guessing some kind of private file global concurrent map which takes the class instance as key and the cached result as its value is another possibility? Anyone know of a better way to handle this in Kotlin?