Popularity
4.6
Declining
Activity
3.1
-
6
2
4

Monthly Downloads: 15
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Tags: Math     Random     Vector    
Latest version: v0.1.1

perfect-vector-shuffle alternatives and similar packages

Based on the "Random" category.
Alternatively, view perfect-vector-shuffle alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of perfect-vector-shuffle or a related project?

Add another 'Random' Package

README

perfect-vector-shuffle

Build Status

A library providing Fisher--Yates in-place shuffles and related functionality.

As an example of how to use it:

module Main where

import           Data.Vector
import           Immutable.Shuffle

main :: IO ()
main =
  do
    shuffleMyVector >>= print
    cycleMyVector   >>= print
    derangeMyVector >>= print

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

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

cycleMyVector :: IO (Vector Int)
cycleMyVector = maximalCycleM myVector

derangeMyVector :: IO (Vector Int)
derangeMyVector = derangementM myVector

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

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