What's the difference between the two definitions?
def f[F[_]: Async](...) = ???
def f[F[_]](...)(implicit F: Async[F]) = ???
later I can use Async[F].async {}
in first case and F.async {}
in second
But i can't figure out the difference. Thx.
What's the difference between the two definitions?
def f[F[_]: Async](...) = ???
def f[F[_]](...)(implicit F: Async[F]) = ???
later I can use Async[F].async {}
in first case and F.async {}
in second
But i can't figure out the difference. Thx.
I would say, it is just a matter of personal preference.
One is a syntactic sugar to other, You can go with any one of them and achieve same thing.
Note that, you are able to use this
Async[F].async {}
just because someone already definedapply
method which looks similar to your second option.If that was not the case, then you had to write it like
implicitly[Async[F]].async {}