lift
inline fun <A, B, C, D> lift(crossinline fl: (A) -> C, crossinline fr: (B) -> D): (Validated<A, B>) -> Validated<C, D>(source)
Lifts two functions to the Bifunctor type.
import arrow.core.*
fun main(args: Array<String>) {
//sampleStart
val f = Validated.lift(String::toUpperCase, Int::inc)
val res1 = f("test".invalid())
val res2 = f(1.valid())
//sampleEnd
println("res1: $res1")
println("res2: $res2")
}
Content copied to clipboard