Skip to content

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.

1 participant