module Control.Concurrent.Stack (
Stack,
stackNew,
stackPush,
stackPeek,
stackTryPeek,
stackPop,
stackTryPop,
stackIsEmpty,
stackSize,
)
where
import Control.Monad.STM
import Numeric.Natural
import qualified Control.Concurrent.STM.Stack as STM
import Control.Concurrent.STM.Stack (Stack)
stackNew :: IO (Stack a)
stackNew = atomically STM.stackNew
stackPush :: Stack a -> a -> IO ()
stackPush stack item = atomically (STM.stackPush stack item)
stackTryPeek :: Stack a -> IO (Maybe a)
stackTryPeek stack = atomically (STM.stackTryPeek stack)
stackPeek :: Stack a -> IO a
stackPeek stack = atomically (STM.stackPeek stack)
stackTryPop :: Stack a -> IO (Maybe a)
stackTryPop stack = atomically (STM.stackTryPop stack)
stackPop :: Stack a -> IO a
stackPop stack = atomically (STM.stackPop stack)
stackIsEmpty :: Stack a -> IO Bool
stackIsEmpty stack = atomically (STM.stackIsEmpty stack)
stackSize :: Stack a -> IO Natural
stackSize stack = atomically (STM.stackSize stack)