get Or Handle
Deprecated
This API is considered redundant. If this method is crucial for you, please let us know on the Arrow Github. Thanks! https://github.com/arrow-kt/arrow/issues Use other getOrElse signature
Replace with
getOrElse(default)
Content copied to clipboard
Returns the value from this Right or allows clients to transform the value from Left with the default lambda.
Example:
import arrow.core.Either.Right
import arrow.core.Either.Left
import arrow.core.getOrHandle
fun main() {
Right(12).getOrHandle { 17 } // Result: 12
Left(12).getOrHandle { it + 5 } // Result: 17
}
Content copied to clipboard