Typed Function and Currying in Scala -


In Scala, I have such a function:

  def foo [R] ] (X: string, y: () => R):   

then I can:

  val something: int = foo ("Bar", {() => 13})   

Is there any way to use function curry without "losing" the type of second argument? ; nothing) Some Val: int = bar ((=) 13)

  case class foo (x: string) AnyVal {def apply [r] (y: (=);): r = y ()} val bar = foo ("bar") Val some: int = Bar ((=) = 13) // int = 13    

Comments

Popular posts from this blog

sql - Return Function using Cursor -

c++ - why does this code produce a runtime error? -

javascript - Is there any way to add a new parameter to a function programmatically? -