-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Lock free Treiber stack -- -- An implementation of Treiber stacks, a lock free stack. Works with any -- monad that has atomically modificable references. Removed debug code -- accidentally left in in version 0.0.1 and added specializations of the -- TreiberStack data structure to the IO and STM monads. @package Treiber @version 0.0.2 -- | An implementation of Treiber stacks, a lock free stack. Works with any -- monad that has atomically modificable references. module Data.NonBlocking.LockFree.Treiber -- | A Lock-free concurrent Treiber stack usable in any monad, m, that is -- paired with a reference type, r, by an instance of -- MonadAtomicRef. Can use Specializations TreiberStackIO and -- TreiberStackSTM data TreiberStack r a -- | Creates a new empty instance of the TreiberStack. Internally -- implemented with a reference of type r, which is why they must be -- atomically modifiable. newTreiberStack :: (MonadAtomicRef r m, Eq a) => m (TreiberStack r a) -- | Pushes an element on to a Treiber stack. pushTreiberStack :: (MonadAtomicRef r m, Eq a) => TreiberStack r a -> a -> m () -- | Pops an element of a Treiber stack. Returns Nothing if the -- stack is empty. popTreiberStack :: (MonadAtomicRef r m, Eq a) => TreiberStack r a -> m (Maybe a) instance Eq a => Eq (TreiberElem r a)