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

Partial function application #451

Open
radrow opened this issue May 13, 2023 · 0 comments
Open

Partial function application #451

radrow opened this issue May 13, 2023 · 0 comments
Labels
effort: medium enhancement New feature or request

Comments

@radrow
Copy link
Member

radrow commented May 13, 2023

This is an extension to #228, inspired by Scala. Function applications could be conveniently curried away, for example for convenience of higher order functions and to aid features proposed in #449 and #450.

Example syntax

function(x, y, z) = ...

f(1, _, 3)  // (y) => f(1, y, z)
f(_, 2, _) // (x, z) => f(x, 2, z)

The curried-out parameters can be numbered for more flexibility:

f($1, $2, $1)  // (a1, a2) => f(a1, a2, a1)
@radrow radrow added enhancement New feature or request effort: medium labels May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: medium enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant