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

lift

@JvmName("lift") fun <A, B> ~~lift~~(arg0: (A) -> B): (Kind<Kind<ForConst, A>, A>) -> Kind<Kind<ForConst, A>, B> Deprecated: Kind/type constructors will be deprecated, so this typeclass will no longer be available from 0.13.0

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.const.functor.*
import arrow.core.*


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

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

Do you like Arrow?

Arrow Org
<