Given a Tuple3, e.g. ("one", "two", "three")
I want to obtain tuple2, which contains only first two elements ("one", "two")
.
One way to do this is something like that:
val (one, two, _) = ("one", "two", "three")
val result = (one, two)
But what if I want to do a similar thing getting tuple14 from tuple16? Boilerplate.
UPDATE:
More specific usecase (func2 and func3 can't be changed).
def func3(one: String, two: String, three: String) = println("Do something")
def func2(one: String, two: String) = println("Do something 2")
val originalTuple = ("one", "two", "three")
val newTuple = ???
(func3 _).tupled(originalTuple)
(func2 _).tupled(newTuple)