HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulerandom-shuffle-0.0.4Haskell98

System.Random.Shuffle

  • 3 values
valueshuffle :: [a] -> [Int] -> [a]
#

Given a sequence (e1,...en) to shuffle, and a sequence (r1,...r[n-1]) of numbers such that r[i] is an independent sample from a uniform random distribution [0..n-i], compute the corresponding permutation of the input sequence.

valueshuffle' :: RandomGen gen => [a] -> Int -> gen -> [a]
#

Given a sequence (e1,...en) to shuffle, its length, and a random generator, compute the corresponding permutation of the input sequence.