aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Plugin.hs13
-rw-r--r--src/Plugin/Base.hs17
2 files changed, 19 insertions, 11 deletions
diff --git a/src/Plugin.hs b/src/Plugin.hs
index 6522e0b..41b0296 100644
--- a/src/Plugin.hs
+++ b/src/Plugin.hs
@@ -1,21 +1,12 @@
module Plugin
- ( Plugin
- , matchPlugin
+ ( matchPlugin
, performPlugin
, plugins
) where
import Text.Regex.TDFA
-type PluginAction = String -> String
-
-data Plugin = Plugin
- { matchRegex :: String
- , perform :: PluginAction
- }
-
-instance Show Plugin where
- show (Plugin r p) = "matchRegex = " ++ r
+import Plugin.Base
matchPlugin :: String -> Maybe Plugin
matchPlugin message = firstPlugin $ matchPlugins message plugins
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