Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- newtype RoundRobin a = RoundRobin (IORef [a])
- newRoundRobin :: [a] -> IO (RoundRobin a)
- select :: RoundRobin a -> IO a
Documentation
newtype RoundRobin a Source
A simple round-robin table useful for selecting resource using round-robin fashion.
RoundRobin (IORef [a]) |
Eq (RoundRobin a) Source |
newRoundRobin :: [a] -> IO (RoundRobin a) Source
create a round-robin table from list.
If list is empty, an error will be raised.
select :: RoundRobin a -> IO a Source
select an item from round-robin table.