[Haskell-cafe] random shuffle and random list partition

Manlio Perillo manlio_perillo at libero.it
Mon Mar 16 19:15:39 EDT 2009


For my Netflix Prize project I have implemented two reusable modules.
The first module implements a random shuffle on immutable lists.
It uses http://okmij.org/ftp/Haskell/perfect-shuffle.txt, with an 
additional "wrapper" function, having a more friendly interface.

The second module implements a function used to partition a list into n 
sublists of random length.

I have pasted the modules here:

If someone is interested (and if Oleg give me permission), I can release 
them as a package on Hackage.
I need to improve documentation, however.

In future I can add an implementation of the random shuffle algorithm on 
mutable arrays in the ST monad.


More information about the Haskell-Cafe mailing list