aboutsummaryrefslogtreecommitdiffstats
path: root/src/Bot.hs
diff options
context:
space:
mode:
authorTeddy Wing2017-09-11 00:48:23 +0200
committerTeddy Wing2017-09-13 04:47:08 +0200
commit3698d614bca4f88c2ffb0c4bf7867e8c5b140b8a (patch)
treee7d488acc1c7028eb4d093cf5e63aec1b993c9b2 /src/Bot.hs
parent3b35cb9872af5f866521250547671c329ffbfe13 (diff)
downloadsorbot-3698d614bca4f88c2ffb0c4bf7867e8c5b140b8a.tar.bz2
Bot: Try adding a BotConfig type
Tried adding this to replicate some code I had been reading, but ultimately it didn't really change anything. In the end I don't need this type, at least not right now, but it was an interesting exercise I suppose.
Diffstat (limited to 'src/Bot.hs')
-rw-r--r--src/Bot.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Bot.hs b/src/Bot.hs
index a661ea4..fe1b0a1 100644
--- a/src/Bot.hs
+++ b/src/Bot.hs
@@ -1,15 +1,19 @@
--- {-# LANGUAGE ConstraintKinds #-}
+{-# LANGUAGE ConstraintKinds #-}
-- {-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Bot
( Bot(..)
+ , BotConfig
) where
import Control.Monad.Reader
import CliOptions (Options)
+type BotConfig = MonadReader Options
+
newtype Bot a = Bot
{ runBot :: ReaderT Options IO a
- } deriving (Monad, Functor, Applicative, MonadIO)
+ -- } deriving (Monad, Functor, Applicative, BotConfig, MonadIO)
+ } deriving (Monad, Functor, Applicative, MonadReader Options, MonadIO)