ZVON > References > Haskell reference
| Indexes | Syntax | Prelude | Ratio | Complex | Numeric | Ix | Array | >> List << | Maybe | Char | Monad | IO | Directory | System | Time | Locale | CPUTime | Random

Module: List
Function: transpose
Type: [[a]] -> [[a]]
Description: transposes the rows and columns of its argument
Related: group, groupBy, inits, intersperse, mapAccumL, mapAccumR, nub, nubBy, partition, sort, sortBy, tails

Example 1

Input: transpose [[1,2,3],[4,5,6],[7,8,9]]

Output: [[1,4,7],[2,5,8],[3,6,9]]

Example 2

Input: transpose [[1],[4,5],[7,8,9]]

Output: [[1,4,7],[5,8],[9]]

Example 3

Input: transpose ["ABCD","abcd"]

Output: ["Aa","Bb","Cc","Dd"]