[Haskell-cafe] Perfect shuffle on std. libs
Felipe Almeida Lessa
felipe.lessa at gmail.com
Sat Jul 14 11:57:59 EDT 2007
I wonder why Oleg's perfect shuffle isn't on any standard library?
Is there a reason or is it just a lack of patches?
I'd personally like to have at least the function
> shuffle :: RandomGen g => g -> [a] -> [a]
> shuffle gen list =
> let len = length list
> ran = [r `mod` k | (k,r) <- zip [len,len-1..2] randoms gen]
> in shuffle1 cartas rs'
where shuffle1 is Oleg's perfect shuffle and length is the
More information about the Haskell-Cafe