Commit c5977c2e authored by Joachim Breitner's avatar Joachim Breitner

Extend the docs for Data.List.transpose

by giving a sufficient general example to explain what happens when the
rows are not of the same lengths. Thanks to Doug McIlroy for the
suggestoin. Fixes #10128.
parent 1def53fe
......@@ -468,6 +468,10 @@ intercalate xs xss = concat (intersperse xs xss)
-- For example,
--
-- > transpose [[1,2,3],[4,5,6]] == [[1,4],[2,5],[3,6]]
--
-- If some of the rows are shorter than the following rows, their elements are skipped:
--
-- > transpose [[10,11],[20],[],[30,31,32]] == [[10,20,30],[11,31],[32]]
transpose :: [[a]] -> [[a]]
transpose [] = []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment