Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- data RoundRobin a
- newRoundRobin :: NonEmpty a -> IO (RoundRobin a)
- select :: RoundRobin a -> IO a
- set :: RoundRobin a -> NonEmpty a -> IO ()
Documentation
data RoundRobin a Source #
A simple round-robin table useful for selecting resource using round-robin fashion.
Eq (RoundRobin a) Source # | |
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.