We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
I discovered today that to use syntax extension for parTraverse/parSequence, a Monad[M] instance is required.
parTraverse
parSequence
Monad[M]
final class ParallelTraversableOps[T[_], A](val ta: T[A]) extends AnyVal { def parTraverse[M[_]: Monad, F[_], B] (f: A => M[B])(implicit T: Traverse[T], P: Parallel[M, F]): M[T[B]] = Parallel.parTraverse(ta)(f) }
While Parallel.parTraverse is defined as follows (notice lack of Monad[M])
Parallel.parTraverse
def parTraverse[T[_]: Traverse, M[_], F[_], A, B] (ta: T[A])(f: A => M[B])(implicit P: Parallel[M, F]): M[T[B]] = { val gtb: F[T[B]] = Traverse[T].traverse(ta)(f andThen P.parallel.apply)(P.applicative) P.sequential(gtb) }
Same is true for parSequence. Is that an oversight?
The text was updated successfully, but these errors were encountered:
Yes it is, unfortunately we can't change it until cats 2.0. There's already a PR at #2180
Sorry, something went wrong.
Seems like this issue missed cats 2.0 opportunity. Might be worth labeling it with 3.0.
3.0
Why can't we change it? Implicits can be changed in a binary compatible way by making the old ones non-implicit and adding the new ones.
Successfully merging a pull request may close this issue.
I discovered today that to use syntax extension for
parTraverse
/parSequence
, aMonad[M]
instance is required.While
Parallel.parTraverse
is defined as follows (notice lack ofMonad[M]
)Same is true for
parSequence
. Is that an oversight?The text was updated successfully, but these errors were encountered: