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


-- | A fast concurrent unique identifier supply with a pure API
--   
--   A fast supply of concurrent unique identifiers suitable for use within
--   a single process. Once the initial <a>Supply</a> has been initialized,
--   the remainder of the API is pure. See <a>Control.Concurrent.Supply</a>
--   for details.
@package concurrent-supply
@version 0.1.8


-- | A fast unique identifier supply with local pooling and replay support.
--   
--   One often has a desire to generate a bunch of integer identifiers
--   within a single process that are unique within that process. You could
--   use UUIDs, but they can be expensive to generate; you don't want to
--   have your threads contending for a single external counter if the
--   identifier is not going to be used outside the process.
--   
--   <tt>concurrent-supply</tt> builds a tree-like structure which can be
--   split; you can make smaller unique supplies and then you allocate from
--   your supplies locally. Internally it pulls from a unique supply one
--   block at a time as you walk into parts of the tree that haven't been
--   explored.
module Control.Concurrent.Supply

-- | A user managed globally unique variable supply.
data Supply

-- | Grab a new supply. Any two supplies obtained with newSupply are
--   guaranteed to return disjoint sets of identifiers. Replaying the same
--   sequence of operations on the same Supply will yield the same results.
newSupply :: IO Supply

-- | Obtain a fresh Id from a Supply.
freshId :: Supply -> (Int, Supply)

-- | Split a supply into two supplies that will return disjoint identifiers
splitSupply :: Supply -> (Supply, Supply)

-- | An unboxed version of freshId
freshId# :: Supply -> (# Int#, Supply #)

-- | An unboxed version of splitSupply
splitSupply# :: Supply -> (# Supply, Supply #)
instance GHC.Show.Show Control.Concurrent.Supply.Supply
instance GHC.Classes.Ord Control.Concurrent.Supply.Supply
instance GHC.Classes.Eq Control.Concurrent.Supply.Supply
instance Data.Hashable.Class.Hashable Control.Concurrent.Supply.Supply
instance GHC.Classes.Eq Control.Concurrent.Supply.Block
instance GHC.Classes.Ord Control.Concurrent.Supply.Block
instance GHC.Show.Show Control.Concurrent.Supply.Block
instance Data.Hashable.Class.Hashable Control.Concurrent.Supply.Block
instance GHC.Base.Functor Control.Concurrent.Supply.Stream
