isLeft

Returns true if this is a Left, false otherwise.


inline fun isLeft(predicate: (A) -> Boolean): Boolean

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
}