Fixes #2233. We'd been holding off on this change because we thought it would necessarily require both source and binary compatibility breakage, but it turns out we can fix it without breaking binary compatibility with Cats 1.x.
Note that this change does break source compatibility pretty dramatically, but the migration path will generally be pretty clear (add .Aux, maybe an explicit type parameter here or there). Anyway, as Rob Norris says here, the current API is so awkward to use that this is unlikely to break much code.
With this change you can use parallel syntax without having to thread an extra type parameter everywhere through your code. Taking an example from the README of cats-par (a library for working around the limitations of the current API), this PR allows us to write the following:
import cats._ import cats.implicits._ import cats.data._ def withNewParallel[F[_]: Monad: Parallel, A, C, D]( as: List[A], f: A => Kleisli[F, C, D] ): Kleisli[F, C, List[D]] = as.parTraverse(f)
With the current API we have to include an extra parameter G[_], both here and all the way up our call stack:
def withOldParallel[F[_]: Monad, G[_], A, C, D]( as: List[A], f: A => Kleisli[F, C, D] )(implicit P: Parallel[F, G]): Kleisli[F, C, List[D]] = as.parTraverse(f)
Note that the only changes to the tests are a few Auxs (and one fewer type parameter in one applicativeError call); otherwise the usage exercised in the tests didn't require changes.