-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add syntax <&> for parallel #2671
Conversation
@@ -3,6 +3,9 @@ package cats.syntax | |||
import cats.{FlatMap, Foldable, Monad, Parallel, Traverse} | |||
|
|||
trait ParallelSyntax extends TupleParallelSyntax { | |||
implicit final def catsSyntaxParallelApply[F[_], A, B](fa: F[A => B]): ParallelApplyOps[F, A, B] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, you can't add a method to a trait without breaking binary compatibility in Scala 2.11.
You need to add a new trait to add this method and have relevant objects extending it. And then you can have AllSyntaxBinCompat4
(a new trait introduced post 1.5.0 release) extend this.
Codecov Report
@@ Coverage Diff @@
## master #2671 +/- ##
==========================================
+ Coverage 95.12% 95.12% +<.01%
==========================================
Files 364 365 +1
Lines 6707 6753 +46
Branches 285 285
==========================================
+ Hits 6380 6424 +44
- Misses 327 329 +2
Continue to review full report at Codecov.
|
I think you can add your syntax to the trait introduced here (in a similar way): #2600 (it was after 1.5.0) |
thanks @kailuowang @kubukoz I added it to |
I don't think anyone looks at the coverage reports, but if you want you can add a doctest to ensure this works as expected (I'm not sure syntax is being tested in ParallelSuite) |
Good, I personally think the syntaxsuite is good enough for covering the syntax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
in #2038 introduced
&>
and<&
syntax for parallel which are very helpfulwhy not have a
<&>
too, so I caninstead of
Parallel.parAp(mab)(ma)