In short it takes User.apply as a function first. On every function (here of type Function3) you can invoke tupled to convert its parameters list to corresponding tuple type. Because it’s all about Function the example above can also be written as:
or even simpler:
//if companion object exists it must extend FunctionX e.g.:
object User extends Function3[String, String, Int, User]
This one is possible only in two cases: either if User doesn’t have companion object or if its companion object extends appropriate FunctionX.