lift
Lifts a function (B) -> C
to the Ior structure returning a polymorphic function that can be applied over all Ior values in the shape of Ior
import arrow.core.*
fun main(args: Array<String>) {
//sampleStart
val f = Ior.lift<Int, CharSequence, String> { s: CharSequence -> "$s World" }
val ior: Ior<Int, CharSequence> = Ior.Right("Hello")
val result = f(ior)
//sampleEnd
println(result)
}
Content copied to clipboard