Avoid infix, tuple, and function syntax when using kind-projector#3209
Avoid infix, tuple, and function syntax when using kind-projector#3209travisbrown wants to merge 1 commit intotypelevel:masterfrom
Conversation
djspiewak
left a comment
There was a problem hiding this comment.
FWIW, I use function and tuple types with kind-projector all the time. Infix syntax, less so, though obviously it's the same code path. As a general stylistic rule, I think of Function1 and Tuple2 (and family) as being implementation details, and the eternally preferred way of referencing them should be their symbolic form.
|
@djspiewak Okay, thanks! I think "yes, we need |
Codecov Report
@@ Coverage Diff @@
## master #3209 +/- ##
=======================================
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.
|
|
See #3215 for a subset of these changes that I think are reasonable. |
This is more a question than a proposal, I guess. I'm working on
-Ykind-projectorfor Dotty, and I have a WIP implementation that I've confirmed can compile cats-core after #3207, #3193, and the change here (and one big Simulacrum rewrite).I think it makes sense to try to minimize the scope of Dotty's kind-projector compatibility, and right now my implementation only handles the type-level
λ[x => ...]syntax and*in ordinary type application (F[A, *, B, *, C]). This is a really tiny change—around 50 lines in the parser behind a singleif (ctx.settings.YkindProjector.value). Adding support for*in tuple types, function types, and infix types would be a lot more invasive.Maybe we should do it anyway, but for Cats at least only supporting
*in type application isn't a very painful limitation—it only requires the changes here, and I think some of these changes (likeA Ior *toIor[A, *]) are readability improvements, anyway.