Sebastian Fischer wrote: > On Jul 28, 2009, at 11:06 AM, Sittampalam, Ganesh wrote: > >>> perms = sortByM (const [True,False]) >> >> and moreover the results will depend on the sorting algorithm chosen. > > Is it only that different sorting algorithms enumerate all > permutations in different orders or is there a sorting algorithm, > such that the above definition does not enumerate all permutations? > [..] > 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 "at least once" bit - unless your non-determinism is based on set rather than bag semantics, it's wrong to duplicate results. Ganesh =============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html =============================================================================== _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe