isLeft
Returns true
if this is a Left, false
otherwise.
Returns false
if Right or returns the result of the given predicate to the Left value.
import arrow.core.Either
import arrow.core.Either.Left
import arrow.core.Either.Right
import io.kotest.matchers.shouldBe
fun test() {
Left(12).isLeft { it 10 } shouldBe true
Left(7).isLeft { it 10 } shouldBe false
val right: Either<Int, String> = Right("Hello World")
right.isLeft { it 10 } shouldBe false
}
Content copied to clipboard