roundRobin-0.1.0.1: A simple round-robin data type

Safe HaskellSafe
LanguageHaskell2010

Data.RoundRobin

Synopsis

Documentation

newtype RoundRobin a Source

A simple round-robin table useful for selecting resource using round-robin fashion.

Constructors

RoundRobin (IORef [a]) 

Instances

newRoundRobin :: [a] -> IO (RoundRobin a) Source

create a round-robin table from list.

If list is empty, an error will be raised. will use NonEmpty in future(ghc 8 are widely used).

select :: RoundRobin a -> IO a Source

select an item from round-robin table.