aboutsummaryrefslogtreecommitdiffstats
path: root/src/Plugin/Base.hs
blob: fe3a0f82c5f5ca295cb4de32a39f24ffd967b47a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module Plugin.Base
    ( PluginAction

    , Plugin(..)
    ) where

import Database.SQLite.Simple

import Message

-- TODO: Replace Connection with a type class
type PluginAction = Message -> Connection -> IO (Either String String)

data Plugin = Plugin
    { matchRegex :: String
    , perform    :: PluginAction
    }

instance Show Plugin where
    show (Plugin r p) = "matchRegex = " ++ r