-
Notifications
You must be signed in to change notification settings - Fork 52
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
Fix lambda precedence #1470
Fix lambda precedence #1470
Conversation
prettyPrec p t@(TLam {}) = | ||
pparens (p > 9) $ | ||
prettyLambdas t |
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.
@byorgey I assume this is overly pessimistic - in the example case, only the inner lambda requires parentheses.
However, the least amount of parentheses might be harder to read. 😄
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.
Hah, yes, in theory, a lambda at the very tail end of an expression does not need parentheses, but that would be annoying to read. I think this is fine.
b303b9e
to
e2b02a1
Compare
prettyPrec p t@(TLam {}) = | ||
pparens (p > 9) $ | ||
prettyLambdas t |
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.
Hah, yes, in theory, a lambda at the very tail end of an expression does not need parentheses, but that would be annoying to read. I think this is fine.
Before (with #1459):
After: