map Left
The given function is applied if this is a Left.
Example:
import arrow.core.*
fun main() {
Either.Right(12).mapLeft { "flower" } // Result: Right(12)
Either.Left(12).mapLeft { "flower" } // Result: Left("flower")
}
Content copied to clipboard