summaryrefslogtreecommitdiff
path: root/HsBot/Base
diff options
context:
space:
mode:
Diffstat (limited to 'HsBot/Base')
-rw-r--r--HsBot/Base/State.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/HsBot/Base/State.hs b/HsBot/Base/State.hs
index c4c361a..2547501 100644
--- a/HsBot/Base/State.hs
+++ b/HsBot/Base/State.hs
@@ -1,3 +1,8 @@
+-- {-# LANGUAGE MultiParamTypeClasses #-}
+-- {-# LANGUAGE FunctionalDependencies #-}
+-- {-# LANGUAGE FlexibleInstances #-}
+-- {-# LANGUAGE NoMonomorphismRestriction #-}
+
module HsBot.Base.State where
import qualified Data.Map as M
@@ -13,6 +18,15 @@ data State = State {
users :: [User]
} deriving (Show, Read)
+makeDefaultState :: State
+makeDefaultState = State {
+ isReady = False,
+ currentSender = "",
+ currentChannel = "",
+ line = "",
+ users = []
+ }
+
stateNumUsers :: State -> Int
stateNumUsers state = length $ users state