-
-
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
Avoid kind-projector syntax with variance annotations #3207
Avoid kind-projector syntax with variance annotations #3207
Conversation
Also /cc @djspiewak. |
Codecov Report
@@ Coverage Diff @@
## master #3207 +/- ##
=======================================
Coverage 93.05% 93.05%
=======================================
Files 376 376
Lines 7412 7412
Branches 192 192
=======================================
Hits 6897 6897
Misses 515 515
Continue to review full report at Codecov.
|
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.
The reason why kind projector exists is for the cases where you can't use a type alias (in type signatures).
It's funny how once we have it we forget that in all other cases you can just use a type alias.
👍 looks clearer now.
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.
seems an improvement to me.
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.
This is definitely one of the corners of kind-projector that I don't care for at all. Also it has some weird caveats to it such that, in general, when you need variance or bounds or things, you usually end up being explicit with a type alias anyway. So I'm in favor of this change unambiguously.
Dotty currently reserves
*
for use as a type lambda placeholder for compatibility with kind-projector's syntax on Scala 2, via a currently-unimplemented-Ykind-projector
compiler option. It's not clear whether-Ykind-projector
should or will support kind-projector'sλ[`-α` => Whatever[α]]
syntax, or even-*
. (I'm working on implementing-Ykind-projector
at the moment, and personally I don't see compatibility with the goofier corners of kind-projector's syntax as a priority.)Cats only uses kind-projector's variance annotations in this one file, and they're pretty easy to replace, and in my view the vanilla Scala syntax is clearer, anyway.
/cc @smarter