Partial function application #451

Open
opened 2023-05-13 18:23:15 +09:00 by zxq9 · 0 comments
zxq9 commented 2023-05-13 18:23:15 +09:00 (Migrated from gitlab.com)

Created by: radrow

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)
*Created by: radrow* 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) ```
Sign in to join this conversation.
No Milestone
No project
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: QPQ-AG/sophia#451
No description provided.