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 - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -