19 Dec 01:27
Re: Add 'subsequences' and 'permutations' to Data.List (ticket #1990)
David Benbennick <dbenbenn <at> gmail.com>
2007-12-19 00:27:58 GMT
2007-12-19 00:27:58 GMT
On Dec 18, 2007 12:56 PM, Bertram Felgenhauer <bertram.felgenhauer <at> googlemail.com> wrote: > finally, we could make it slightly more lazy Good point, your version is much better. The same issue applies to permutations. I haven't had time to write out the code yet, but I can imagine a version of permutations that does: permutations [1..] = [1...], [2,1, ...], [1,3,2 ...], [2,3,1 ...], [3,1,2 ...], [3,2,1 ...], ... so that the expression (take 10 $ map (take 10) $ permutations [1..]) isn't bottom.
RSS Feed