From 762df21ff369fa4ddf7409c62181802c47d4214b Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 2 Aug 2017 02:29:18 +0200 Subject: GitHubCommit.hs: Make types of `ChannelRepoUrl` more specific Define some extra types in `ChannelRepoUrl` because I didn't like the generic ones. --- src/Plugin/GitHubCommit.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Plugin/GitHubCommit.hs') 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 -- cgit v1.2.3