getOrElse

infix inline fun <V, E> Result<V, E>.getOrElse(transform: (E) -> V): V

Returns the value if this Result is Ok, otherwise the transformation of the error.