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

c++ - 'std::string' has no member named 'get' list[i]=user.get; -

python - how we can use ajax() in views.py in django? -

java - Instances of classes -