arrow-core-data / arrow.core / Ior / lift
@JvmStatic fun <A, B, C> lift(f: (B) -> C): (
Ior
<A, B>) ->
Ior
<A, C>
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<A, B>
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)
}
@JvmStatic fun <A, B, C, D> lift(fa: (A) -> C, fb: (B) -> D): (
Ior
<A, B>) ->
Ior
<C, D>
Do you like Arrow?
✖