Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- data Module st = Module {
- moduleSerialize :: !(Maybe (Serial st))
- moduleDefState :: !(LB st)
- moduleSticky :: !Bool
- moduleCmds :: !(ModuleT st LB [Command (ModuleT st LB)])
- moduleInit :: !(ModuleT st LB ())
- moduleExit :: !(ModuleT st LB ())
- contextual :: !(String -> Cmd (ModuleT st LB) ())
- newModule :: Module st
- data ModuleID st
- newModuleID :: IO (ModuleID st)
- data ModuleInfo st = ModuleInfo {
- moduleName :: !String
- moduleID :: !(ModuleID st)
- theModule :: !(Module st)
- moduleState :: !(MVar st)
- data ModuleT st m a
- runModuleT :: ModuleT st m a -> ModuleInfo st -> m a
Documentation
The Module type class.
Module | |
|
newModuleID :: IO (ModuleID st) Source #
data ModuleInfo st Source #
Info about a running module.
ModuleInfo | |
|
Instances
Monad m => MonadReader (ModuleInfo st) (ModuleT st m) Source # | |
Defined in Lambdabot.Module ask :: ModuleT st m (ModuleInfo st) # local :: (ModuleInfo st -> ModuleInfo st) -> ModuleT st m a -> ModuleT st m a # reader :: (ModuleInfo st -> a) -> ModuleT st m a # |
This transformer encodes the additional information a module might need to access its name or its state.
Instances
runModuleT :: ModuleT st m a -> ModuleInfo st -> m a Source #