-
-
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
Make Parallel's F a type member #3012
Conversation
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, thanks! This has been a long time coming
Codecov Report
@@ Coverage Diff @@
## master #3012 +/- ##
=========================================
- Coverage 93.6% 93.6% -0.01%
=========================================
Files 368 368
Lines 6948 6946 -2
Branches 188 185 -3
=========================================
- Hits 6504 6502 -2
Misses 444 444
Continue to review full report at Codecov.
|
NIce, how come this (it doesn't break BC) didn't occur to us. |
y'all reading in my mind, I thought about this just a couple days ago... a very welcome change! |
recent discussion at scala/scala#9303 has us wondering if this change was in fact safe. (which might affect decisions to make other such changes in the future) |
Wow, took us long enough! I can't remember any case in the ecosystem where this broke anything, but I would wager Parallel isn't that popular an abstraction in libraries, which could be why - everyone just updated cats and their sources and they were fine. (I think) |
Perhaps y'all should |
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:
With the current API we have to include an extra parameter
G[_]
, both here and all the way up our call stack:Note that the only changes to the tests are a few
Aux
s (and one fewer type parameter in oneapplicativeError
call); otherwise the usage exercised in the tests didn't require changes.