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.
|
joroKr21
left a comment
There was a problem hiding this comment.
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.
kailuowang
left a comment
There was a problem hiding this comment.
seems an improvement to me.
djspiewak
left a comment
There was a problem hiding this comment.
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-projectorcompiler option. It's not clear whether-Ykind-projectorshould or will support kind-projector'sλ[`-α` => Whatever[α]]syntax, or even-*. (I'm working on implementing-Ykind-projectorat 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