map

inline fun <D> map(f: (B) -> D): Ior<A, D>(source)

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")
}