
24 Aug
2020
24 Aug
'20
5:25 a.m.
On Sun, 23 Aug 2020, David Feuer wrote:
Data.List.transpose, unfortunately, can potentially leak space. The problem is that it walks a list of lists twice: once to get the heads and once to get the tails. Depending on the way the result is consumed, it's possible that heads or tails that are never used will be retained by the garbage collector. I have a fix[*] that probably makes the function slower in typical cases, but that plugs the leak. What do y'all say?
Your way sounds more correct than using 'head' and 'tail'. I have no numbers, though.