Copyright | 2019 Daniel YU |
---|---|
License | MIT |
Maintainer | leptonyu@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Synopsis
- class (Monad m, Monad n) => MonadFactory env n m | m -> env n where
- defer :: MonadFactory env n m => n () -> m ()
- asksEnv :: MonadFactory env n m => (env -> a) -> m a
- withEnv :: MonadFactory env n m => (env -> m env) -> m ()
- modifyEnv :: MonadFactory env n m => (env -> env) -> m ()
- runEnv :: MonadFactory env n m => m c -> m (env, c)
Documentation
class (Monad m, Monad n) => MonadFactory env n m | m -> env n where Source #
Monads which allow to produce component
under env
, and env
can be changed by this procedure.
defer :: MonadFactory env n m => n () -> m () Source #
Defer to run side effect when closeing resource.
asksEnv :: MonadFactory env n m => (env -> a) -> m a Source #
Asks sub value of env.
withEnv :: MonadFactory env n m => (env -> m env) -> m () Source #
Change environment env
.
modifyEnv :: MonadFactory env n m => (env -> env) -> m () Source #
Modify environment env
.
runEnv :: MonadFactory env n m => m c -> m (env, c) Source #
Run factory, return component c
and updated environment env
.