-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make given
clauses come last
#6513
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
So far pathTo(span) would only guarantee to return the path to the closest tree enclosing `span` if trees were non-overlapping. This is property does not hold for typed trees, yet `pathTo` is called from `Interactive` on such typed trees. This commit makes `pathTo` work correctly also for overlapping trees.
With given coming last, some of the no-overlaps and in-order position checks have to be weakened. But with the more generalized pathTo implementation, non-overlapping and in-order is not really needed anymore.
They printed as normal arguments before.
The previous syntax was unparseable without major contortions in the Parser.
Can do it now that we have a full bootstrap.
These were printed as old-style implicit parameters before. This is in preparation for merging it with `Implied`. We already compensate for it when printing modifiers by eliding it when it appear with `Param`.
Synthesized creator expressions for classes passed all parameters as normal arguments. This works no longer with `given` clauses. We have use `given` arguments for those.
We now forbid given clauses followed by normal parameter clauses. besides the syntactic awkwardness, there's also the problem of eta expansion. Example: ``` trait Universe { type T } def f given (u: Universe) (x: u.T) ``` How should we tea expand `f`? The usual algorithm would give: ``` (x: u.T) => (f given the[Universe])(x) ``` but that's ill typed, since `u` is not defined on the outside.
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.
Hello, and thank you for opening this PR! 🎉
All contributors have signed the CLA, thank you! ❤️
Commit Messages
We want to keep history, but for that to actually be useful we have
some rules on how to format our commit messages (relevant xkcd).
Please stick to these guidelines for commit messages:
- Separate subject from body with a blank line
- When fixing an issue, start your commit message with
Fix #<ISSUE-NBR>:
- Limit the subject line to 72 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line ("Add" instead of "Added")
- Wrap the body at 80 characters
- Use the body to explain what and why vs. how
adapted from https://chris.beams.io/posts/git-commit
Have an awesome day! ☀️
We now forbid given clauses followed by normal parameter clauses.
besides the syntactic awkwardness, there's also the problem
of eta expansion. Example:
How should we eta expand
f
? The usual algorithm would give:but that's ill typed, since
u
is not defined on the outside.(only last commit is new)