-
Notifications
You must be signed in to change notification settings - Fork 465
Tricky case for uncurried by default when .
appears in non head positions
#5792
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
Comments
How about "res.async"? Maybe we can parse it |
Had some related exploring rescript-lang/syntax#683 |
The idea is that by reading |
I think this comment is about what happens in a single parenthesised thing Not sure if disallowing |
Added this under the overall uncurried by default issue #5597 |
I recently took care of the printing side in rescript-lang/syntax#668. Do we have the budget to implement this breaking change right now? (Budget as in release-wise, implementation effort is a 5min change) |
This seems part of rescript-lang/syntax#683, which is for v11. |
Actually this I think the issue is something else: that I thought that the original proposal was only to ban Assuming this stronger ban is the intention, one could instead:
With that choice, assuming current curried by default mode is C, and the new uncurried by default mode is U, the conversion from C to U would turn |
Similarly, |
There are also some issues one cannot easily get around without telling the parser whether it is in curried or uncurried mode. Without a distinction between uncurried and curried mode, one would have to be safe and format |
I suggest we have a simple and clean semantics of curring/uncurring in the stage as early as possible. Depending on the ppx transformation is not reliable, the formatter is also hard to get it right. To make the formatter easier to write, here is the encoding I proposed that we should do it in the parsing stage instead of relying on the later transformations. The current workflow is that we parse it as curried call with |
Added an issue for this: #5793 |
Summary of the issue. First, the meaning of switching between normal mode and uncurried mode. So the idea is to only flip the first element in a parens group. So one could forbid the problematic example, as the flipping rule does not give the desired result. However, flipping after formatting does. So it's not necessary to forbid it. In summary, if a term does not have dots in the middle then it can be converted to uncurried form by flipping. |
.
appears in non head positions.
appears in non head positions
.
appears in non head positions.
appears in non head positions
.
should be only allowed in the first position(. x , y) => x + y
The text was updated successfully, but these errors were encountered: