Missing Ykind-projector
usecase that prevent cross-compilation with Scala 2 : higher-kind-parameterised type-lambdas
#17673
Baccata
started this conversation in
Feature Requests
Replies: 2 comments
-
Moving this to feature request since we make no guarantees about -Ykind-projector, but contributions to reach parity with the scala 2 plugin are welcome! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The documentation of kind-projector provides valuable information as to what is and what isn't possible to cross-compile. This is greatly appreciated, however, here's a usecase that doesn't seem to have a non-projection-based way of cross-compilng with Scala 2.
Compiler version
3.2.1
Minimized example
The problem can be described as a formulation a type lambda that depends on a method bound and that expresses partial application where of a parametric type, where the free type variable is higher-kinded.
We're trying to express when its
F
paramerter is fixed,PolyFunction
forms aFunctorK
Scala 3 :
Scala 2 (using the kind-projector compiler plugin)
The only way I'm aware of cross-compiling this is to resort to the de-sugared Scala 2 encoding :
Desugared encoding, which compiles on both Scala 2 and Scala 3
Expectation
I'd personally appreciate if the support for
λ
in Scala 3 was not limited to*
-kinded type parameters, and if we could write the following, which compiles in Scala 2 using kind-projector.Beta Was this translation helpful? Give feedback.
All reactions