I am new to Scala and was reading about partially applied functions in Scala. I've a general function "wrap" which can concatenate three strings.
def wrap(prefix: String)(html: String)(suffix: String) = prefix + html + suffix
When I try to make a specialized function like this
val foo = wrap(_)("Hello")(_)
It fails with Missing parameter type error, but works if I provide type for first argument, like this
val foo = wrap(_:String)("Hello")(_)
My questions are:
Why do I have to provide the type redundantly? I had already provided it in general definition of wrap.
Why it doesn't require type for last argument?
val semiwrap :String => String => String = wrap(_)("Hello")- jwvh