diff options
author | Teddy Wing | 2017-07-30 19:36:28 +0200 |
---|---|---|
committer | Teddy Wing | 2017-07-30 19:36:28 +0200 |
commit | e4b00259ec4c1338f766561aba3b7a3a3159d216 (patch) | |
tree | 8ea8a29c3de9268d114041fc636354b1b8820ea7 /src/Plugin/Base.hs | |
parent | 487f8f805647d3f3fbb86aac6838f0c0e37a6bde (diff) | |
download | sorbot-e4b00259ec4c1338f766561aba3b7a3a3159d216.tar.bz2 |
Move `Plugin` and `PluginAction` to a new module
Move our base plugin types to a new module to enable us to use them in
both the plugin matching code (which we'll leave in "Plugin.hs") and in
specialised plugin modules.
This enables us to import and provide a list of plugins in `plugins` in
"Plugin.hs" and use these types in that file and in the plugin files
without any circular/recursive module dependencies.
Diffstat (limited to 'src/Plugin/Base.hs')
-rw-r--r-- | src/Plugin/Base.hs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Plugin/Base.hs b/src/Plugin/Base.hs new file mode 100644 index 0000000..c73ef6a --- /dev/null +++ b/src/Plugin/Base.hs @@ -0,0 +1,17 @@ +module Plugin.Base + ( PluginAction + + , Plugin(..) + , matchRegex + , perform + ) where + +type PluginAction = String -> String + +data Plugin = Plugin + { matchRegex :: String + , perform :: PluginAction + } + +instance Show Plugin where + show (Plugin r p) = "matchRegex = " ++ r |