Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
A simple stack implementation
Instances
Foldable Stack Source # | |
Defined in Math.Haskellator.Internal.Utils.Stack 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
:: (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
Pop an element from the stack. If the stack is empty, an error is thrown.