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
Syntax for partially applied functions #147
Comments
|
If it shall desugar app exprs recursively, how about parentheses? Say, |
It could be, but it shouldn't be. |
Parenthesis is not part of the AST. In you example, it's an argument of an application. The original messages mentions this:
|
So, IIUC, |
Basically, it should be inserted immediately except for a few special cases. I list a few of them in my original message (there might be more though). So, if it does not make sense to insert lambda in some place, it should be inserted higher. For example, this happens in Binops is a special case. It certainly possible to have a lambda under binop, but it rarely happens in practice and it is more natural to desugar |
Yes |
|
Shall be fixed by #199? |
Implement a notation for partially functions such as
f(a,-,c)
. I suggest__
because-
and_
are already taken.The lambda should be inserted only in specific positions such as the argument of an application (but not in infix operator).
If
__
occurs more than once in an expression, this can be interpreted either as a lambda with two parameters or as a lambda with one parameter which is used twice. For example,__ * a + __ * b
could be interpreted as either\lam x y => x * a + y * b
or\lam x => x * a + x * b
. The first interpretation looks more natural to me.The text was updated successfully, but these errors were encountered: