map
Maps (transforms) the success value T to a new value R
import io.kresult.core.KResult
import io.kotest.matchers.shouldBe
fun test() {
KResult.Success(2)
.map {
it * it
}
.getOrNull() shouldBe 4
}
Content copied to clipboard
Parameters
f
transform the KResult.Success type T to R.