Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#10128 closed bug (fixed)

Data.List.transpose needs more docs

Reported by: nomeata Owned by: ekmett
Priority: normal Milestone: 7.10.1
Component: Core Libraries Version: 7.8.4
Keywords: Cc: core-libraries-committee@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


as mentioned by Doug McIlroy on haskell-prime.

My preference in the interest of brevity would be to not include the equations that Doug mentioned and simply add his nicely constructed educating example to the docs:

The transpose function transposes the rows and columns of its argument. 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]]

Change History (3)

comment:1 Changed 5 years ago by Joachim Breitner <mail@…>

In c5977c2e2951e9e346a8f4990d5a6bbdbf9cee0b/ghc:

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.

comment:2 Changed 5 years ago by nomeata

Resolution: fixed
Status: newclosed

comment:3 Changed 5 years ago by thoughtpolice

Milestone: 7.10.1
Note: See TracTickets for help on using tickets.