-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | STM wrapper around Control.Concurrent.Supply.
--   
--   STM wrapper around Control.Concurrent.Supply for thread-safe ID
--   generation.
@package stm-supply
@version 0.2.0.0


module Control.Concurrent.STMSupply

-- | newtype wrapper around a TVar Supply.
data STMSupply

-- | Construct a new <tt>STMSupply</tt> in the IO Monad.
newSTMSupplyIO :: IO STMSupply

-- | Using an <tt>STMSupply</tt>, atomically get a fresh ID.
freshId :: STMSupply -> STM Int

-- | Using an <tt>STMSupply</tt>, atomically split the underlying
--   <tt>Supply</tt> into two. Stores one of the new supplies in the
--   STMSupply that was the first argument, and returns the second Supply.
splitSupply :: STMSupply -> STM STMSupply
