roundRobin-0.1.2.0: A simple round-robin data type

Safe HaskellSafe
LanguageHaskell2010

Data.RoundRobin

Synopsis

Documentation

data RoundRobin a Source #

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

Instances

newRoundRobin :: NonEmpty 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.

set :: RoundRobin a -> NonEmpty a -> IO () Source #

set a new round-robin table.