hotswap-0.1.9.13: Simple code hotswapping.

Safe HaskellSafe-Infered

System.Plugins.Hotswap

Synopsis

Documentation

data Plugin a Source

Constructors

Plugin 

Fields

pluginObject :: FilePath

Path to object

pluginIncludes :: [FilePath]

Include paths.

pluginDataName :: String

Name of the symbol to find.

pluginData :: IORef a

Loaded data.

pluginModule :: IORef Module

Loaded module.

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.

usePluginIO :: Plugin (a -> IO b) -> a -> IO bSource

usePlugin for plugins returning IO.

runPlugin :: Plugin (IO a) -> IO aSource

runPlugin runs an 'IO a' returning Plugin.

reloadPlugin :: Plugin a -> IO ()Source

Reload a plugin in-place.

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.

putPlugin :: Plugin a -> a -> IO ()Source

Replace the contents of the pluginData.