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

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

matlab - Using loops to get multiple values into a cell -

python - Sequence Pattern recognition with Pybrain -