choose-0.1.0.0: Choose random elements from a stream.

Safe HaskellSafe
LanguageHaskell2010

Data.Random.Choose.IO

Description

IO-specific functionality around the random selection algorithm described in Data.Random.Choose.

Synopsis

Documentation

getSelectionsIO Source #

Arguments

:: Ord a 
=> IO (Maybe a)

Producer of items to choose from; produces Nothing when there are no more items)

-> Int

n: Number of items to choose

-> IO [a]

n of the items (or all of the items if fewer than n are produced)

Selects n items uniformly at random from an input stream.