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

Add surface syntax for partial application of uncurried functions #6166

Merged
merged 4 commits into from
Apr 17, 2023

Conversation

cristianoc
Copy link
Collaborator

@cristianoc cristianoc commented Apr 16, 2023

Fixes #6165

This PR introduces a new surface syntax for partial application of uncurried functions in ReScript. The syntax allows developers to partially apply uncurried functions more easily and concisely using the ... token in argument lists. The implementation includes changes to the parser, grammar, and printer to handle the new syntax properly.

Example:

@@uncurried

let add = (a, b, c) => a + b + c
let ptl1 = add(1, ...)
let result = ptl1(2, 3) // result will be 6

This example demonstrates the new syntax for partial application of the uncurried add function.

Fixes #6165

This PR introduces a new surface syntax for partial application of uncurried functions in ReScript. The syntax allows developers to partially apply uncurried functions more easily and concisely using the ... token in argument lists. The implementation includes changes to the parser, grammar, and printer to handle the new syntax properly.

Example:

res
Copy code
let add = (a, b) => a + b
let ptl1 = add(1, ...)
let result = ptl1(2) // result will be 3
This example demonstrates the new syntax for partial application of the uncurried add function.
CHANGELOG.md Outdated Show resolved Hide resolved
cristianoc and others added 3 commits April 16, 2023 09:23
@cristianoc cristianoc added this to the v11.0 milestone Apr 17, 2023
@cristianoc cristianoc merged commit c0d0ae0 into master Apr 17, 2023
2 checks passed
@cristianoc cristianoc deleted the ptl-app-syntax branch April 17, 2023 01:26
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.

Add surface syntax for partial application of uncurried functions.
2 participants