Stack-0.3.0: Stack data structure

Safe HaskellSafe
LanguageHaskell2010

Control.Concurrent.STM.Stack

Description

Provides a synchronized stack for use in the STM monad

See also Control.Concurrent.Stack

Synopsis

Documentation

data Stack a Source #

Synchronized stack data type

stackNew :: STM (Stack a) Source #

Create new Stack

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

Push item onto Stack

stackPeek :: Stack a -> STM a Source #

Pop most recently added item without removing from the Stack

Automatically retries if stack is empty

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

Pop most recently added item without removing from the Stack

stackPop :: Stack a -> STM a Source #

Pop most recently added item from Stack

Automatically retries if stack is empty

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

Pop most recently added item from Stack

stackIsEmpty :: Stack a -> STM Bool Source #

Test if stack is empty

stackSize :: Stack a -> STM Natural Source #

Compute number of elements contained in the Stack