A list of items with relative frequencies of appearance.
- data Frequency a
- uniformFreq :: String -> [a] -> Frequency a
- toFreq :: String -> [(Int, a)] -> Frequency a
- scaleFreq :: Show a => Int -> Frequency a -> Frequency a
- filterFreq :: (a -> Bool) -> Frequency a -> Frequency a
- rollFreq :: Show a => Frequency a -> StdGen -> (a, StdGen)
- nullFreq :: Frequency a -> Bool
- runFrequency :: Frequency a -> [(Int, a)]
The frequency distribution type.
Takes a name and a list of frequencies and items into the frequency distribution.
Scale frequecy distribution, multiplying it by a positive integer constant.
Leave only items that satisfy a predicate.
Randomly choose an item according to the distribution.