aboutsummaryrefslogtreecommitdiffstats
path: root/src/Plugin/GitHubCommit.hs
diff options
context:
space:
mode:
authorTeddy Wing2017-08-02 02:29:18 +0200
committerTeddy Wing2017-08-02 02:29:18 +0200
commit762df21ff369fa4ddf7409c62181802c47d4214b (patch)
tree464166b49c17ae9aa1a49f9c9d4e49387df519c8 /src/Plugin/GitHubCommit.hs
parenta6007bffdbbeb8391b2b8991377857c475308e83 (diff)
downloadsorbot-762df21ff369fa4ddf7409c62181802c47d4214b.tar.bz2
GitHubCommit.hs: Make types of `ChannelRepoUrl` more specific
Define some extra types in `ChannelRepoUrl` because I didn't like the generic ones.
Diffstat (limited to 'src/Plugin/GitHubCommit.hs')
-rw-r--r--src/Plugin/GitHubCommit.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Plugin/GitHubCommit.hs b/src/Plugin/GitHubCommit.hs
index e5af381..4175fb8 100644
--- a/src/Plugin/GitHubCommit.hs
+++ b/src/Plugin/GitHubCommit.hs
@@ -16,8 +16,12 @@ gitHubCommitAction :: PluginAction
gitHubCommitAction message =
"https://github.com/" ++ M.text message =~ matchRegex gitHubCommit
+type Id = Int
+
+type RepoUrl = String
+
-- | A type to match the database table for this plugin.
-data ChannelRepoUrl = ChannelRepoUrl Int String String deriving (Show)
+data ChannelRepoUrl = ChannelRepoUrl Id M.Channel RepoUrl deriving (Show)
instance FromRow ChannelRepoUrl where
fromRow = ChannelRepoUrl <$> field <*> field <*> field