perfect-vector-shuffle: Library for performing vector shuffles

[ bsd3, library, program, random, vector ] [ Propose Tags ]

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]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0, 0.1.1, 0.1.1.1, 0.1.1.2
Change log CHANGELOG.md
Dependencies base (>=4.9 && <4.15), MonadRandom (>=0.5.1.1 && <0.6), primitive (>=0.6.4 && <0.8), random (>=1.1 && <1.2), vector (>=0.12.0 && <0.13) [details]
License BSD-3-Clause
Copyright 2019
Author Callan McGill
Maintainer callan.mcgill@gmail.com
Revised Revision 2 made by callanmcgill at 2020-06-04T16:44:58Z
Category Random, Vector
Home page https://github.com/Boarders/perfect-vector-shuffle
Bug tracker https://github.com/Boarders/perfect-vector-shuffle/issues
Source repo head: git clone https://github.com/Boarders/perfect-vector-shuffle
Uploaded by callanmcgill at 2019-05-02T19:17:19Z
Distributions
Downloads 1705 total (19 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]