mapLeft
The given function is applied if this is a Left or Both to A
.
Example:
import arrow.core.Ior
fun main() {
Ior.Right(12).mapLeft { "flower" } // Result: Right(12)
Ior.Left(12).mapLeft { "flower" } // Result: Left("power")
Ior.Both(12, "power").mapLeft { "flower $it" } // Result: Both("flower 12", "power")
}
Content copied to clipboard