Is it possible to create a partially applied function with named parameter?

scala

Solution

As noted by Travis this works:

def foo( a: String = "bar", b: Int = 1, c: String = "default" ): String = s"$a$b$c"                                                
val fooc = (c: String) => foo(c = c)            
fooc("myc")
//> res0: String = bar1myc        

Problem

This function is provided ``` def foo( a: String = "bar", b: Int = 1, c: String = "default" ): String ``` Is there a way to create a partial function `String => String` without specifying `a` and `b`? My approach `foo( c = _: String )` does unfortunately not compile. Are there any alternatives?

Original source

Related problems