Safe Haskell | None |
---|
- data PluginHandle
- data PluginConf = PluginConf {
- pcGHCArgs :: [String]
- pcWhenCompiling :: FilePath -> IO ()
- pcWhenCompiled :: FilePath -> [String] -> IO ()
- pcWhenReloaded :: FilePath -> String -> [String] -> IO ()
- pcWhenWatched :: FilePath -> IO ()
- pcWhenChanged :: FilePath -> IO ()
- initPlugins :: IO PluginHandle
- initPluginsWithConf :: PluginConf -> IO PluginHandle
- defaultPluginConf :: PluginConf
- withServerPart :: Name -> ExpQ
- withServerPart_ :: (MonadIO m, ServerMonad m, FilterMonad Response m, WebMonad Response m) => Name -> a -> PluginHandle -> ([String] -> a -> m b) -> m b
Documentation
data PluginHandle Source
Dummy plugin handle. In a static configuration its values are not used at all.
data PluginConf
Configuration options for recompiling plugins. So far we store here event callbacks and ghc arguments.
PluginConf | |
|
initPlugins :: IO PluginHandleSource
Creates a dummy plugin handle.
initPluginsWithConf :: PluginConf -> IO PluginHandleSource
Creates a dummy plugin handle.
defaultPluginConf :: PluginConf
Contains no arguments for GHC, and noop callbacks.
withServerPart :: Name -> ExpQSource
A template haskell wrapper around withServerPart_
.
Usage:
$(withServerPart 'symbol) pluginHandle id $ \errors a -> ...
:: (MonadIO m, ServerMonad m, FilterMonad Response m, WebMonad Response m) | |
=> Name | name of the symbol to dynamically load |
-> a | the symbol (must be the function refered to by the |
-> PluginHandle | Handle to the function reloader |
-> ([String] -> a -> m b) | function which uses the loaded result, and gets a list of compilation errors if any |
-> m b |
a static version of withServerPart_
This function has the same signature as its dynamic sibling, but it does not do any fancy dynamic loading. It simply applies the function to the supplied value.
This function exists so that you can that you can compile using dynamic plugins during development, but statically link the final build.
Use a CPP to select between the Dynamic and Static versions of this module.