The only way to get F[C]
from F[A => B => C]
is if you can apply an A
and a B
to it. That is, you'll need to evaluate the contained function. Use the apply
twice, once to get an B => C
and then once again to get C
.
def eval(myApp: F[A => B => C])(value: F[A]): F[B => C]
def evalAgain(myApp: F[B => C])(value: F[B]): F[C]
but if you just want to be able to get F[C]
directly from the function itself without evaluation, you're SOL.
Edit:
I believe it would look like this.
def eval(myApp: F[A => B => C])(value: F[A], next: F[B])(implicit ap: Applicative[F[_]]) = ap(ap(myApp, value), next)