Add 'subsequences' and 'permutations' to Data.List (ticket #1990)

Yitzchak Gale gale at
Sat Dec 22 13:28:17 EST 2007

Twan van Laarhoven wrote:
>   permutations7':                        4.750 sec
>   permutations7', using 3 for recursion: 4.250 sec
>   permutations8:                         3.984 sec
>   permutations8b:                        2.250 sec
>   permutations8b, using 3 for recursion: 1.984 sec

Great work!

> My current preference is 8 or 8b, using a different function in the
> recursion is going to far for my taste.

Perhaps they could be combined somehow, e.g., re-use

You should run your times with a control that just adds
up 10! copies of [1..10]. On my machine, that takes about
1 sec.

So when we subtract out the control, satisfying the consistency
property increases run time by at least a factor of 4.
The property is nice, but is it worth that penalty?
I'm not sure, I'd be interested in hearing other people's


More information about the Libraries mailing list