You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add surface syntax for partial application of uncurried functions (#6166)
* Add surface syntax for partial application of uncurried functions
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.
* Update CHANGELOG.md
Co-authored-by: Christoph Knittel <[email protected]>
* Update CHANGELOG.md
* Update CHANGELOG.md
---------
Co-authored-by: Christoph Knittel <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,9 @@
12
12
13
13
# 11.0.0-alpha.4 (Unreleased)
14
14
15
+
#### :rocket: Main New Feature
16
+
- Add surface syntax for partial application of uncurried functions: `foo(1, ...)`. This corresponds to curried application in the old mode. https://github.com/rescript-lang/rescript-compiler/pull/6166
17
+
15
18
#### :bug: Bug Fix
16
19
17
20
- Fix broken formatting in uncurried mode for functions with _ placeholder args. https://github.com/rescript-lang/rescript-compiler/pull/6148
0 commit comments