The identity transformation of F
to F
Lifts function f
of F[A] => G[A]
into a FunctionK[F, G]
.
Lifts function f
of F[A] => G[A]
into a FunctionK[F, G]
.
def headOption[A](list: List[A]): Option[A] = list.headOption val lifted: FunctionK[List, Option] = FunctionK.lift(headOption)
Note: This method has a macro implementation that returns a new
FunctionK
instance as follows:
new FunctionK[F, G] { def apply[A](fa: F[A]): G[A] = f(fa) }
Additionally, the type parameters on f
must not be specified.