Portability | portable |
---|---|
Stability | experimental |
Maintainer | tamar@zhox.com |
Contains a pseudo implementation of an artificial stack. This is used to print a StackTrace out and manipulate the stack.
- data Stack
- class Show a => Stackable a where
- type FunctionName = String
- emptyStack :: Stack
- pushStack :: Stackable st => st -> FunctionName -> Stack
- topStack :: Stack -> Maybe FunctionName
- popStack :: Stack -> Stack
- newStack :: FunctionName -> Stack
- sizeStack :: Stack -> Int
- shrinkStack :: Stack -> Stack
- printStack :: Stack -> String
Documentation
A simple stack implementation
type FunctionName = StringSource
Creating an empty stack
pushStack :: Stackable st => st -> FunctionName -> StackSource
Adding an element to the top of the stack
topStack :: Stack -> Maybe FunctionNameSource
Look at the item at the top of the stack, but does not remove it
newStack :: FunctionName -> StackSource
Create a new stack from a template
shrinkStack :: Stack -> StackSource
Shrinks and Compress the stack, reducing the stack to the bare minimum of steps/calls needed to represent the same stack
printStack :: Stack -> StringSource
Pretty print a stack back out to a string