| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vgrep.Type
Description
The VgrepT monad transformer allows reading from the Environment
and changing the state of the App or a Widget.
- data VgrepT s m a
- type Vgrep s = VgrepT s Identity
- mkVgrepT :: Monad m => (s -> Environment -> m (a, s)) -> VgrepT s m a
- runVgrepT :: Monad m => VgrepT s m a -> s -> Environment -> m (a, s)
- modifyEnvironment :: Monad m => (Environment -> Environment) -> VgrepT s m ()
- vgrepBracket :: IO a -> (a -> IO c) -> (a -> VgrepT s IO b) -> VgrepT s IO b
- lift :: MonadTrans t => forall m a. Monad m => m a -> t m a
- hoist :: MFunctor t => forall m n b. Monad m => (forall a. m a -> n a) -> t m b -> t n b
- module Vgrep.Environment
The VgrepT monad transformer
Instances
| Monad m => MonadState s (VgrepT s m) Source # | |
| Monad m => MonadReader Environment (VgrepT s m) Source # |
|
| MFunctor (VgrepT s) Source # | |
| MonadTrans (VgrepT s) Source # | |
| Monad m => Monad (VgrepT s m) Source # | |
| Functor m => Functor (VgrepT s m) Source # | |
| Monad m => Applicative (VgrepT s m) Source # | |
| MonadIO m => MonadIO (VgrepT s m) Source # | |
| Monad m => Zoom (VgrepT s m) (VgrepT t m) s t Source # | |
| type Zoomed (VgrepT s m) Source # | |
mkVgrepT :: Monad m => (s -> Environment -> m (a, s)) -> VgrepT s m a Source #
Lift a monadic action to VgrepT.
runVgrepT :: Monad m => VgrepT s m a -> s -> Environment -> m (a, s) Source #
Pass an initial state and an Environment and reduce a VgrepT
action to an action in the base monad.
Modifying the environment
modifyEnvironment :: Monad m => (Environment -> Environment) -> VgrepT s m () Source #
The Environment of VgrepT is not stateful, however it can be
modified globally. An example is resizing the application by changing
the display bounds.
Utilities
Re-exports
lift :: MonadTrans t => forall m a. Monad m => m a -> t m a #
Lift a computation from the argument monad to the constructed monad.
hoist :: MFunctor t => forall m n b. Monad m => (forall a. m a -> n a) -> t m b -> t n b #
Lift a monad morphism from m to n into a monad morphism from
(t m) to (t n)
module Vgrep.Environment