Safe Haskell | Safe-Infered |
---|
- data Plugin a = Plugin {
- pluginObject :: FilePath
- pluginIncludes :: [FilePath]
- pluginDataName :: String
- pluginData :: IORef a
- pluginModule :: IORef Module
- newPlugin :: FilePath -> [FilePath] -> String -> IO (Plugin a)
- usePlugin :: Plugin (a -> b) -> a -> IO b
- usePluginIO :: Plugin (a -> IO b) -> a -> IO b
- runPlugin :: Plugin (IO a) -> IO a
- reloadPlugin :: Plugin a -> IO ()
- readPlugin :: Plugin a -> IO a
- withPlugin :: Plugin a -> (a -> a) -> IO ()
- withPluginIO :: Plugin a -> (a -> IO a) -> IO ()
- putPlugin :: Plugin a -> a -> IO ()
Documentation
Plugin | |
|
newPlugin :: FilePath -> [FilePath] -> String -> IO (Plugin a)Source
Create a new plugin, expecting a type. Don't use this to reload plugins.
usePlugin :: Plugin (a -> b) -> a -> IO bSource
usePlugin
provides a simple way to use plugins of type 'Plugin (a -> b)', ie, only
single argumented ones.
reloadPlugin :: Plugin a -> IO ()Source
Reload a plugin in-place.
readPlugin :: Plugin a -> IO aSource
Read the pluginData
IORef
.
withPlugin :: Plugin a -> (a -> a) -> IO ()Source
withPlugin
provides a way to run a function on a plugin, modifying the plugin in-place.
withPluginIO :: Plugin a -> (a -> IO a) -> IO ()Source
withPlugin
for functions returning IO.