我想改变以下顺序。
Seq[((A, B, C, D), Seq[(E, F, G)])]
到
Seq[(A, B, C, D, Seq[(E, F, G)])]
有人可以建议解决方案吗?
谢谢!
答案 0 :(得分:6)
简单地:
val original: Seq[((A, B, C, D), Seq[(E, F, G)])] = ...
val res: Seq[(A, B, C, D, Seq[(E, F, G)])] =
original.map { case ((a, b, c, d), seq) => (a, b, c, d, seq) }