-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Docs/higher kinded v2 #135
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
Conversation
Here are a few remarks from my side. Are they correct? Shall I add some of them to this document? A parametrized class extending another parametrized class, such as
is treated as
Another example:
You say that "the notion of type parameters makes sense even for encoded types". Can/will we push it even further and say it makes also sense for user-provided types without type parameter lists, eg given
it would be acceptable to write
instead of
The current rules on wildcards imply the following (or at least that's how I read them): If a type Note that this is different to current Scala, where (3) has a weird consequence: Suppose I have a variable
We would look for a member called So I think when rewriting standard type applications
With these rules, dotty would behave the same as current Scala, and accept How to prove
Apply eta-expansion on
which we can reduce to
|
Cool! For a full encoding of F^{sub}_{Omega}, see also Table 2 of https://lirias.kuleuven.be/bitstream/123456789/186941/1/scalina-final.pdf |
On Mon, Jun 2, 2014 at 8:48 AM, Adriaan Moors [email protected] wrote:
Which presumably would allow the encoding of type Id[T] = T? Cheers, Miles Miles Sabin |
Yes, it's a true encoding of higher-order System F with subtyping. Martin's version documented here is as well, I think. |
@odersky, @Ichoran, @namin Regarding type projection: why do we need a structural rule for
Of course there are the usual considerations with transitivity, but they are orthogonal to the encoding of type lambdas with an Apply type member. |
For type aliases it's indeed beta-reduction. But for abstract types we need something else I believe. |
Ah yes, to re-cap our discussion at the whiteboard:
naively translates to
... but, then what's the type for The only thing I could come up with is:
so that |
definitions, abstract types, and type parameters. In the new scheme, | ||
only classes (and traits) can have parameters and these are treated as | ||
equivalent to type members. Type aliases and abstract types do not | ||
allow the definition of type members so we have to interprete |
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.
Should "don't allow the definition of type members" be "... parameterized type definitions"?
Adapted docs so that they reflect what has been implemented.
Backport "sbt 1.10.5 (was 1.9.9)" to 3.3 LTS
Adds the higher-kinded schema to the docs.
Review by @DarkDimius @samuelgruetter