mapLeft

inline fun <C> mapLeft(f: (A) -> C): Either<C, B>(source)

Map, or transform, the left value A of this Either to a new value C.

import arrow.core.Either
import io.kotest.matchers.shouldBe

fun test() {
Either.Right(12).mapLeft { _: Nothing -> "flower" } shouldBe Either.Right(12)
Either.Left(12).mapLeft { _: Int -> "flower" } shouldBe Either.Left("flower")
}