Stack-0.4.0: Stack data structure

Safe HaskellSafe
LanguageHaskell2010

Control.Concurrent.Stack

Description

Provides a synchronized stack for use in the IO monad

See also Control.Concurrent.STM.Stack

Synopsis

Documentation

data Stack a Source #

Synchronized stack data type

stackNew :: IO (Stack a) Source #

Create new empty Stack

stackPush :: Stack a -> a -> IO () Source #

Push item onto Stack

stackPeek :: Stack a -> IO a Source #

Pop most recently added item without removing from the Stack

Blocks if stack is empty

stackTryPeek :: Stack a -> IO (Maybe a) Source #

Pop most recently added item without removing from the Stack

stackPop :: Stack a -> IO a Source #

Pop most recently added item from Stack

Blocks if stack is empty

stackTryPop :: Stack a -> IO (Maybe a) Source #

Pop most recently added item from Stack

stackIsEmpty :: Stack a -> IO Bool Source #

Test if stack is empty

stackSize :: Stack a -> IO Natural Source #

Compute number of elements contained in the Stack