get Or Handle
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