Skip to content
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: process uncurried function declarations explicitly in the parser/printer #5794

Merged
merged 11 commits into from
Nov 10, 2022

Conversation

cristianoc
Copy link
Collaborator

No description provided.

@cristianoc cristianoc changed the title process uncurried function declarations explicitly in the parser/printer Syntax: process uncurried function declarations explicitly in the parser/printer Nov 10, 2022
This is not idempotent:
let c2 = (. x) => y => x+y
@cristianoc
Copy link
Collaborator Author

This is not idempotent:

let c2 = (. x) => y => x+y

and is in fact one of the examples considered troublesome for uncurried by default.

Up to now it means: uncurried function with 2 arguments.
How does one then represent an uncurried function with 1 argument that returns a curried function? The only way so far is to enclose the body in {...}.

Interpret the arity of uncurried functions explicitly so this is a unary function:
```
(. x) => y => x+y
```
The parser adds braces to the body to make this explicit.

This is a breaking change. And solves the lack of idempotency in #5794
Interpret the arity of uncurried functions explicitly so this is a unary function:
```
(. x) => y => x+y
```
The parser adds braces to the body to make this explicit.

This is a breaking change. And solves the lack of idempotency in #5794
@cristianoc cristianoc merged commit 4e9c818 into master Nov 10, 2022
@cristianoc cristianoc deleted the direct_uncurry_fundef_encoding branch November 10, 2022 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant