Closed y2k closed 7 years ago
You could use the invoke
style flavour
myProc(1)("")
Is in the same package
As having a multi parameter version is hard to implement due to mathematical constraints. The library will end being in gigabytes size. Scala has this feature embedded inside the compiler.
Other solution is to create your own extension function for your particular case
Yes I understand. One more question.
Why you don't have partially1 for function with one argument?
fun <P1, R> Function1<P1, R>.partially1(p1: P1): () -> R = { this(p1) }
'Cause in that case isn't partial application but parameter binding. Someone suggest that feature on our channel in Kotlin's Slack a few weeks ago
I could consider adding it but with bind
name, not partiallyN
Can I transform function like
fun myProc(a:Int, b: String, c: Float)
tofun myProc(c:Float)
in one step?Right now I use code
myProc.partially1(1).partially1("")
, but maybe there are best solution?