This should be an easy one. How do I apply a function to a tuple in Scala? Viz:
scala> def f (i : Int, j : Int) = i + j
f: (Int,Int)Int
scala> val p = (3,4)
p:
scala> def f (i : Int, j : Int) = i + j
f: (i: Int,j: Int)Int
// Note the underscore after the f
scala> val ff = f _
ff: (Int, Int) => Int =
scala> val fft = ff.tupled
fft: ((Int, Int)) => Int =
scala> def f (i : Int, j : Int) = i + j
f: (Int,Int)Int
// Note the underscore after the f
scala> val ff = f _
ff: (Int, Int) => Int =
scala> val fft = Function.tupled(ff)
fft: ((Int, Int)) => Int =