Stack-0.3.2: Stack data structure
Data.Stack.ST
Description
Provides a stack container for use in the ST monad
ST
Synopsis
data Stack s a Source #
A mutable stack in state thread s, containing values of type a
stackNew :: ST s (Stack s a) Source #
Create new empty Stack
stackPush :: Stack s a -> a -> ST s () Source #
Push item onto Stack
stackPeek :: Stack s a -> ST s (Maybe a) Source #
Pop most recently added item without removing from the Stack
stackPop :: Stack s a -> ST s (Maybe a) Source #
Pop most recently added item from Stack
stackIsEmpty :: Stack s a -> ST s Bool Source #
Test if stack is empty
stackSize :: Stack s a -> ST s Natural Source #
Compute number of elements contained in the Stack