HORIZON HASKELLDocslts/ghc-9.14.x6d5fdfd2026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 6d5fdfd · 2026-10-12

Modulerandom-shuffle-0.0.4Haskell98

System.Random.Shuffle

Synopsis
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.