
28 Jul
2009
28 Jul
'09
1:10 p.m.
On Tue, Jul 28, 2009 at 6:47 AM, Sebastian
Fischer
perms = sortByM (const [True,False]) Hence, perm as defined above can yield a list that contains all permutations of the input (at least once) regardless of the sorting algorithm.
Where is the hitch?
The algorithm might diverge when given a non-transitive comparison operator. On Spore we had a bug where a NaN got into a list of floats we were sorting and our quicksort corrupted the heap because < isn't transitive on lists with NaNs. -- ryan