Supposing I wanted to implement a data-frame type thing in Scala, I might have a class that I could initialize a two column table like this:
val:foo = new MyDataFrame[String, Int]("a", "b")
And when I got a row, I'd expect it's type to be something like:
(String, Int)
That sort of thing is trivial to implement if I have a fixed number of columns, but what if I wanted to make a dataframe that would allow as many columns as I want.
val:foo = new MyDataFrame[Aaa, Bbb, ... Zzz]("ColA", "ColB", .... "ColZ")
Then I'd want my my row to have a type that looks like:
(Aaa, Bbb, ... Zzz)
My question is, how could I implement a class like MyDataFrame where the number of type arguments is not known in advance. I guess this is analogous to the use of Variable arguments when the number of regular inputs to a function cannot be known in advance.