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