module Happstack.Server.Plugins.Static
( PluginHandle
, initPlugins
, withServerPart
, withServerPart_
) where
import Control.Monad.Trans (MonadIO(..))
import Happstack.Plugins.Static (PluginHandle, initPlugins)
import Happstack.Plugins.LiftName (liftName)
import Happstack.Server (ServerMonad, FilterMonad, WebMonad, Response)
import Language.Haskell.TH (ExpQ, Name, appE, varE)
withServerPart :: Name -> ExpQ
withServerPart name = appE (appE [| withServerPart_ |] (liftName name)) (varE name)
withServerPart_ :: (MonadIO m, ServerMonad m, FilterMonad Response m, WebMonad Response m) => Name -> a -> PluginHandle -> (a -> m b) -> m b
withServerPart_ _name fun _objMap use = use fun