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

David Benbennick dbenbenn at
Thu Dec 20 12:25:20 EST 2007

It just occurred to me that permutations doesn't quite agree with the
mathematical concept:

>>> permutations "aaa"

But that's not really a problem, since you can always just compose
permutations with (Set.toList . Set.fromList).

On Dec 20, 2007 7:05 AM, Twan van Laarhoven <twanvl at> wrote:
> Chris Kuklewicz wrote:
> > Unfortunately, permutations5 has an error:

I suggest including some QuickCheck properties with this proposal,
especially a property that would have caught that error.  I'm thinking
of four properties:

1) If x = permutations y, then check length x is right.
2) Check each element of x is a permutation of y
3) Check each permutation of y is an element of x
4) Check for laziness

By the way, to improve mailing list laziness: the proposal is at

More information about the Libraries mailing list