-- | -- = A Module for Stacks module Stack where -- | Stacks are implemented as lists. type Stack a = [a] -- | The empty stack. empty :: Stack a empty = [] -- | Pushing an element on top of a stack. push :: a -> Stack a -> Stack a push = (:) -- | Popping the top element of a stack. pop :: Stack a -> (a, Stack a) pop s = (head s, tail s)