Difference between revisions of "99 questions/Solutions/25"

From HaskellWiki
Jump to navigation Jump to search
(No difference)

Revision as of 15:59, 13 July 2010

Generate a random permutation of the elements of a list.

rnd_permu xs = diff_select' (length xs) xs

Uses the solution for the previous problem. Choosing N distinct elements from a list of length N will yield a permutation.