i want to combine multiple options to an option of a tuple:
val maybeA: Option[Int] = ...
val maybeB: Option[String] = ...
val combined: Option[(Int,String)] = combine(maybeA, maybeB)
there are many ways to do this, let's go with:
def combined[X,Y](maybeA: Option[X], maybeB: Option[Y]) = maybeA.zip(maybeB).headOption
and that's great.
now i wonder, can this be done for varargs and a tuple dynamically somehow? what would the signature look like?
def combine[???](options: Option[?]*): Tuple[?]