Stack-0.1.0: Stack data structure type
Data.Stack
Description
Abstract Stack data type
Synopsis
data Stack a Source #
Instances
Methods
readsPrec :: Int -> ReadS (Stack a) #
readList :: ReadS [Stack a] #
readPrec :: ReadPrec (Stack a) #
readListPrec :: ReadPrec [Stack a] #
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