freckle-app-1.15.2.0: Haskell application toolkit used at Freckle
Safe HaskellSafe-Inferred
LanguageHaskell2010

Freckle.App.Random

Synopsis

Documentation

smallRandomSubsetOfLargeIntegerRange Source #

Arguments

:: (MonadRandom m, Random i, Integral i) 
=> Natural

How many items are wanted

-> Range i 
-> m (Set i) 

Select a fixed number of items uniformly at random from a contiguous range of integers

This process accommodates selecting from a large range, but only has reasonable performance when the number of items being selected is small (it is quadratic in the number of items).

If the requested size is greater than or equal to the range, the entire range is returned.

e.g. smallRandomSubsetOfLargeIntegerRange 10 (inclusiveRange 30 70) may produce something like fromList [32,34,45,54,56,58,62,63,64,65].

data Range i Source #

A possibly-empty contiguous range of integers

data NonEmptyRange i Source #

A nonempty contiguous range of integers

Constructors

NonEmptyRange 

Fields

inclusiveRange Source #

Arguments

:: Integral i 
=> i

Lower bound, inclusive

-> i

Upper bound, inclusive

-> Range i