| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Control.Monad.ConsumableStack
Synopsis
- data ConsumableStackT s (m :: Type -> Type) a
- type ConsumableStack s = ConsumableStackT s Identity
- pop :: MonadConsumableStack s m => m s
- runConsumableStackT :: Functor m => ConsumableStackT s m a -> [s] -> m (Either ConsumableStackError a)
- runConsumableStack :: ConsumableStack s a -> [s] -> Either ConsumableStackError a
- data ConsumableStackError
Documentation
data ConsumableStackT s (m :: Type -> Type) a Source #
A monad transformer with a pop-only stack that is expected to be fully consumed ("popped").
Instances
type ConsumableStack s = ConsumableStackT s Identity Source #
runConsumableStackT :: Functor m => ConsumableStackT s m a -> [s] -> m (Either ConsumableStackError a) Source #
Run a consumable stack monad transformer.
Returns a ConsumableStackError iff the stack was depleted early or not
fully consumed.
runConsumableStack :: ConsumableStack s a -> [s] -> Either ConsumableStackError a Source #