Stack-0.1.0: Stack data structure type

Safe HaskellSafe
LanguageHaskell2010

Data.Stack

Description

Abstract Stack data type

Synopsis

Documentation

data Stack a Source #

Abstract Stack data type

Instances

Read a => Read (Stack a) Source # 
Show a => Show (Stack a) Source # 

Methods

showsPrec :: Int -> Stack a -> ShowS #

show :: Stack a -> String #

showList :: [Stack a] -> ShowS #

stackNew :: Stack a Source #

Create new Stack

stackIsEmpty :: Stack a -> Bool Source #

Test if stack is empty

stackPush :: Stack a -> a -> Stack a Source #

Push item onto Stack

stackPeek :: Stack a -> a Source #

Pop most recently added item without removing from the Stack

stackPop :: Stack a -> (Stack a, a) Source #

Pop most recently item from Stack

stackSize :: Stack a -> Int Source #

Compute number of elements contained in the Stack