happstack-plugins-7.0.1: The haskell application server stack + reload

Safe HaskellNone

Happstack.Server.Plugins.Static

Synopsis

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.

Constructors

PluginConf 

Fields

pcGHCArgs :: [String]

Arguments to ghc

pcWhenCompiling :: FilePath -> IO ()

Called when compilation is about to start. Takes the path of the file to compile.

pcWhenCompiled :: FilePath -> [String] -> IO ()

Called after compilation finished. Takes the path of the compiled file and the compilation errors if any.

pcWhenReloaded :: FilePath -> String -> [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.

pcWhenWatched :: FilePath -> IO ()

Called when a file is registered for watching.

pcWhenChanged :: FilePath -> IO ()

Called when a watched file is modified.

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 -> ...

withServerPart_Source

Arguments

:: (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 Name argument)

-> 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.