isBoth
Returns true
if this is a Both, false
otherwise.
Example:
import arrow.core.Ior
fun main() {
Ior.Left("tulip").isBoth() // Result: false
Ior.Right("venus fly-trap").isBoth() // Result: false
Ior.Both("venus", "fly-trap").isBoth() // Result: true
}
Content copied to clipboard
Returns false
if Right or Left, or returns the result of the application of the given predicate to the Both value.
Example:
import arrow.core.Ior
fun main() {
val right: Ior<Int, Int> = Ior.Right(12)
right.isBoth( {it 10}, {it 6 }) // Result: false
Ior.Both(12, 7).isBoth( {it 10}, {it 6 })// Result: true
val left: Ior<Int, Int> = Ior.Left(12)
left.isBoth ( {it 10}, {it 6 }) // Result: false
}
Content copied to clipboard