Currying Partial application perhaps?
# random
k
Currying Partial application perhaps?
a
How would that look like with a fictional syntax?
e
k
fun sum(a: Int, b: Int) = a + b
and then
::sum(3)
is a function reference with
a
curried. Maybe even allow named parameters...
a
oh, so you are talking about partial application
k
Currying is related to, but not the same as, partial application.
~Wikipedia Dammit, you can tell I'm not that into functional programming.
But yes, turns out I was taking about partial application 🙄
a
partial application + named parameters would be very nice
fun add(x: Int, y: Int) = x + y; val add5 = ::add(y = 5)
😄
👍 1
@cedric ^ what about that syntax for partial application with support for named parameters?
k
What does he have to do with this? Did I miss anything?
a
was a discussion a while ago where cedric said he wanted to have support for named parameters with partial application
in haskell the function-arguments are ordered the "right" way in order to use partial application, e.g.
map
takes the function first and the list as second parameter, so you can apply the same function to multiple lists. in java/kotlin world the arguments are ordered how the library author wants it, so that could possibly render some functions being bad candidates for partial applications if you need to apply the second/third/whatever argument