Convert a tuple of lists of the same length to a list of tuples for arbitrary — Haskell
问题 I'm trying to convert a tuple of lists of the same length: ([Int], [Int], ..) to a list of tuples [(Int, Int, ...)] . This can be accomplished for predetermined sizes with the following code: buildList :: ([a], [a], [a], [a], [a], [a], [a], [a]) -> [(a, a, a, a, a, a, a, a)] buildList ([], [], [], [], [], [], [], []) = [] buildList (a:as, b:bs, c:cs, d:ds, e:es, f:fs, g:gs, h:hs) = (a, b, c, d, e, f, g, h) : buildList (as, bs, cs, ds, es, fs, gs, hs) As you can probably see, this isn't going