random-fu-0.2.6.2: Random number generation

Safe HaskellNone
LanguageHaskell98

Data.Random.List

Synopsis

Documentation

randomElement :: [a] -> RVar a Source

A random variable returning an arbitrary element of the given list. Every element has equal probability of being chosen. Because it is a pure RVar it has no memory - that is, it "draws with replacement."

shuffle :: [a] -> RVar [a] Source

A random variable that returns the given list in an arbitrary shuffled order. Every ordering of the list has equal probability.

shuffleT :: [a] -> RVarT m [a] Source

shuffleN :: Int -> [a] -> RVar [a] Source

A random variable that shuffles a list of a known length (or a list prefix of the specified length). Useful for shuffling large lists when the length is known in advance. Avoids needing to traverse the list to discover its length. Each ordering has equal probability.

shuffleNT :: Int -> [a] -> RVarT m [a] Source

shuffleNofM :: Int -> Int -> [a] -> RVar [a] Source

A random variable that selects N arbitrary elements of a list of known length M.

shuffleNofMT :: Int -> Int -> [a] -> RVarT m [a] Source