| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Math.Haskellator.Internal.Utils.Stack
Documentation
A simple stack implementation
Instances
| Foldable Stack Source # | |
Defined in Math.Haskellator.Internal.Utils.Stack Methods fold :: Monoid m => Stack m -> m # foldMap :: Monoid m => (a -> m) -> Stack a -> m # foldMap' :: Monoid m => (a -> m) -> Stack a -> m # foldr :: (a -> b -> b) -> b -> Stack a -> b # foldr' :: (a -> b -> b) -> b -> Stack a -> b # foldl :: (b -> a -> b) -> b -> Stack a -> b # foldl' :: (b -> a -> b) -> b -> Stack a -> b # foldr1 :: (a -> a -> a) -> Stack a -> a # foldl1 :: (a -> a -> a) -> Stack a -> a # elem :: Eq a => a -> Stack a -> Bool # maximum :: Ord a => Stack a -> a # minimum :: Ord a => Stack a -> a # | |
| Applicative Stack Source # | |
| Functor Stack Source # | |
| Monoid (Stack a) Source # | |
| Semigroup (Stack a) Source # | |
Check if the stack is empty
Arguments
| :: (a -> a) | The function to map |
| -> Stack a | The stack to map over |
| -> Stack a | The new stack, with the top element mapped |
Map a function over the top element of the stack
Arguments
| :: Stack a | The stack to pop from |
| -> (a, Stack a) | The popped element and the stack without the element |
Pop an element from the stack. If the stack is empty, an error is thrown.