As illustrated:
scala> List(List(1, 2), List(3, 4), List(5, 6)) transpose
res7: List[List[Int]] = List(List(1, 3, 5), List(2, 4, 6))
scala> List(List(1, 2), List(3), List(5, 6)) transpose
res8: List[List[Int]] = List(List(1, 3, 5), List(2, 6))
scala> List(List(1, 2), List(3, 4, 7), List(5, 6)) transpose
java.lang.IndexOutOfBoundsException: 2
at scala.collection.immutable.Vector.checkRangeConvert(Vector.scala:104)
...
Is this behaviour deliberate? If so, why?
EDIT: even though part of the question has been clarified, I'd still like to propose a version of this method (perhaps with a different name) that accepts irregular sizes.