HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

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.