Is there a library routine for random permutations? I didn't find any and did a quick hack, which works fine for my application (length of list < 100), but what would be a more elegant way?
> permute :: StdGen -> [a] -> [a] > permute gen [] = [] > permute gen xs = (head tl) : permute gen' (hd ++ tail tl) > where (idx, gen') = randomR (0,length xs - 1) gen > (hd, tl) = splitAt idx xs Markus -- Markus Schnell, Infineon Technologies AG _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell