I have a case class with two fields and a function which accepts the same arguments. Is where a way to pass contents of case class to this function without explicitly specifying all fields or ugly unapplying?
case class User(name: String, age: Int)
val user = User("Peter", 23)
def func(name: String, age: Int) = {...}
func(user.name, user.age) //works
Function.tupled(func(_,_))(User.unapply(user).get) //works, but ugly
// func(_,_) is explicit because it can be a method of a class