diff options
| author | Teddy Wing | 2017-09-11 00:53:30 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2017-09-13 04:47:08 +0200 | 
| commit | ae6949327ed8bd8cfa528da7741333274203af44 (patch) | |
| tree | 040fa1b05213378fe34531e634853608d0c613be /app | |
| parent | 515de5dd5d44fb361fe7ca68d698776e84c4d523 (diff) | |
| download | sorbot-ae6949327ed8bd8cfa528da7741333274203af44.tar.bz2 | |
gitHubCommit: Fix type error
Oh my goodness, it works!!!!!!! I've been wrestling with this for the
past week and a half, and it finally works!
Here's the compiler error I was getting:
    sorbot/src/Plugin/GitHubCommit.hs:25:12: error:
        • Couldn't match type ‘Control.Monad.Trans.Reader.ReaderT r0 m1’
                         with ‘Bot’
          Expected type: Bot t0
            Actual type: Control.Monad.Trans.Reader.ReaderT r0 m1 t0
        • In a stmt of a 'do' block: cfg <- asks language
          In the expression:
            do { cfg <- asks language;
                 return
                   (defaultPlugin
                      {matchRegex = "^[0-9a-f]{40}$", perform = gitHubCommitAction,
                       command = "<git_sha>",
                       description = translate (lang cfg) GitHubCommitDescription}) }
          In an equation for ‘gitHubCommit’:
              gitHubCommit
                = do { cfg <- asks language;
                       return
                         (defaultPlugin
                            {matchRegex = "^[0-9a-f]{40}$", perform = gitHubCommitAction,
                             command = "<git_sha>",
                             description = translate (lang cfg) GitHubCommitDescription}) }
The problem ended up being that I was using the wrong `ask` & `asks`
functions. After a lot of searching online and reading articles and
things about how to set up `ReaderT` configuration, I finally started
looking at some code, from a "language:Haskell newtype app readert"
search on GitHub. Reading different code bits, I tried to compare with
what I had already, kept reading. Finally I noticed that the imports
were different, and I tried getting `ask` not from the transformer
library, and it worked!! OMG! So glad.
Diffstat (limited to 'app')
0 files changed, 0 insertions, 0 deletions
