@hackage perfect-vector-shuffle0.1.0

Library for performing vector shuffles

This package contains functions for performing shuffles on mutable and immutable vectors. The shuffles are uniform at random amongst all permuations.

For an example of how to use it:

module Example where

import Data.Vector
import Immutable.Shuffle

myVector :: Vector Int
myVector = fromList [1..10]

shuffleMyVector :: IO (Vector Int)
shuffleMyVector = shuffleM myVector

This gives the following:

> shuffleMyVector
[1,10,4,7,2,3,5,9,8,6]
> shuffleMyVector
[7,4,2,10,9,8,6,5,1,3]