arrow-core / arrow.core.extensions.tuple2.functor / lift

lift

@JvmName("lift") fun <F, A, B> ~~lift~~(arg0: (A) -> B): (Kind<Kind<ForTuple2, F>, A>) -> Kind<Kind<ForTuple2, F>, B> Deprecated: @extension kinded projected functions are deprecated

Lifts a function A -> B to the F structure returning a polymorphic function that can be applied over all F values in the shape of Kind<F, A>

A -> B -> Kind<F, A> -> Kind<F, B>

 import arrow.core.*
import arrow.core.extensions.tuple2.functor.*
import arrow.core.*


 import arrow.core.extensions.tuple2.applicative.just
import arrow.core.extensions.monoid

 fun main(args: Array<String>) {
  val result =
  //sampleStart
  lift<String, String, String>({ s: CharSequence -> "$s World" })("Hello".just<String,
String>(String.monoid()))
  //sampleEnd
  println(result)
 }

Do you like Arrow?

Arrow Org
<