functionalUpdate

fun <T> functionalUpdate(updater: Any?, input: T): T

Resolves an Updater against an input value.

An updater is either a new value of type T or a function (T) -> T that produces one. When updater is callable it is invoked with input; otherwise it is returned as the new value. The runtime check uses updater is Function<*> to match any function value.