Currently it's not possible to call apply on the classic 'summon' method:
val future: Future[Unit] = ???
def example[F[_]: FromFuture] = {
val fa0 = FromFuture[F[_]](future) //fails to compile
val fa1 = FromFuture.apply[F](future) //fails to compile
val fa2 = FromFuture[F].apply(future) //compiles, but triggers you to replace apply with application
val fa3 = FromFuture.summon[F](future) //fails to compile
val fa4 = FromFuture.summon[F].apply(future) //compiles, but ugly
}
And having FromFuture instance as an explicit parameter is not always convenient.
This PR introduces new partially-applied method to call this like that:
val fa = FromFuture.defer[F](future)
Note that it is possible to achieve the fa0 way of calling it just by renaming new defer method to apply, but this will break existing apply method, which summons the instance. Perhaps it's possible to deprecate it in favour of summon method, and then after its removal introduce said apply method.
Currently it's not possible to call apply on the classic 'summon' method:
And having
FromFuture
instance as an explicit parameter is not always convenient.This PR introduces new partially-applied method to call this like that:
Note that it is possible to achieve the
fa0
way of calling it just by renaming newdefer
method to apply, but this will break existingapply
method, which summons the instance. Perhaps it's possible to deprecate it in favour ofsummon
method, and then after its removal introduce saidapply
method.