-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | The haskell application server stack + reload -- -- This library provides support for automatically recompiling and -- reloading modules into a running server. @package happstack-plugins @version 7.0.1 module Happstack.Server.Plugins.Static -- | Dummy plugin handle. In a static configuration its values are not used -- at all. data PluginHandle -- | Configuration options for recompiling plugins. So far we store here -- event callbacks and ghc arguments. data PluginConf :: * PluginConf :: [String] -> (FilePath -> IO ()) -> (FilePath -> [String] -> IO ()) -> (FilePath -> String -> [String] -> IO ()) -> (FilePath -> IO ()) -> (FilePath -> IO ()) -> PluginConf -- | Arguments to ghc pcGHCArgs :: PluginConf -> [String] -- | Called when compilation is about to start. Takes the path of the file -- to compile. pcWhenCompiling :: PluginConf -> FilePath -> IO () -- | Called after compilation finished. Takes the path of the compiled file -- and the compilation errors if any. pcWhenCompiled :: PluginConf -> FilePath -> [String] -> IO () -- | Called after reloading of the symbol finished. Takes the path of the -- object file, the symbol name and the list of errors if any. pcWhenReloaded :: PluginConf -> FilePath -> String -> [String] -> IO () -- | Called when a file is registered for watching. pcWhenWatched :: PluginConf -> FilePath -> IO () -- | Called when a watched file is modified. pcWhenChanged :: PluginConf -> FilePath -> IO () -- | Creates a dummy plugin handle. initPlugins :: IO PluginHandle -- | Creates a dummy plugin handle. initPluginsWithConf :: PluginConf -> IO PluginHandle -- | Contains no arguments for GHC, and noop callbacks. defaultPluginConf :: PluginConf -- | A template haskell wrapper around withServerPart_. Usage: -- --
--   $(withServerPart 'symbol) pluginHandle id $ \errors a -> ...
--   
withServerPart :: Name -> ExpQ -- | 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. withServerPart_ :: (MonadIO m, ServerMonad m, FilterMonad Response m, WebMonad Response m) => Name -> a -> PluginHandle -> ([String] -> a -> m b) -> m b module Happstack.Server.Plugins.Dynamic -- | A handle holding the reloader state. data PluginHandle :: * -- | Configuration options for recompiling plugins. So far we store here -- event callbacks and ghc arguments. data PluginConf :: * PluginConf :: [String] -> (FilePath -> IO ()) -> (FilePath -> [String] -> IO ()) -> (FilePath -> String -> [String] -> IO ()) -> (FilePath -> IO ()) -> (FilePath -> IO ()) -> PluginConf -- | Arguments to ghc pcGHCArgs :: PluginConf -> [String] -- | Called when compilation is about to start. Takes the path of the file -- to compile. pcWhenCompiling :: PluginConf -> FilePath -> IO () -- | Called after compilation finished. Takes the path of the compiled file -- and the compilation errors if any. pcWhenCompiled :: PluginConf -> FilePath -> [String] -> IO () -- | Called after reloading of the symbol finished. Takes the path of the -- object file, the symbol name and the list of errors if any. pcWhenReloaded :: PluginConf -> FilePath -> String -> [String] -> IO () -- | Called when a file is registered for watching. pcWhenWatched :: PluginConf -> FilePath -> IO () -- | Called when a watched file is modified. pcWhenChanged :: PluginConf -> FilePath -> IO () -- | Initializes the plugin system and return a PluginHandle using -- the default plugin configuration defaultPluginConf. initPlugins :: IO PluginHandle -- | Initializes the plugin system and return a PluginHandle. initPluginsWithConf :: PluginConf -> IO PluginHandle -- | Contains no arguments for GHC, and noop callbacks. defaultPluginConf :: PluginConf -- | dynamically load the specified symbol pass it as an argument to the -- supplied server monad function. -- -- This is a wrapper aronud withServerPart_ which ensures the -- first and second argument stay in-sync. -- -- Usage: -- --
--   $(withServerPart 'symbol) pluginHandle id $ \errors a -> ...
--   
withServerPart :: Name -> ExpQ -- | dynamically load the specified symbol pass it as an argument to the -- supplied server monad function. -- -- If something fails, this function will return '500 Internal Server -- Error' and a list of the errors encountered. -- -- see also: withServerPart withServerPart_ :: (MonadIO m, ServerMonad m, FilterMonad Response m, WebMonad Response m) => Name -> a -> PluginHandle -> ([String] -> a -> m b) -> m b