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