summaryrefslogtreecommitdiff
path: root/State.hs
diff options
context:
space:
mode:
authorpb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157>2010-03-14 12:41:48 +0000
committerpb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157>2010-03-14 12:41:48 +0000
commit1c16624f000070eb996b001cb9bf5a5bce18a7d8 (patch)
tree064781dec938cacfa625c1bdc17883b27d995ffe /State.hs
parentd102f483205bf2969ddf60063ba2b03c0c2b508a (diff)
git-svn-id: https://ssl.buetow.org/repos/hsbot/trunk@24 9f8f72e9-4bf4-416e-b76e-7d4203597157
Diffstat (limited to 'State.hs')
-rw-r--r--State.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/State.hs b/State.hs
index 6076901..27fd11f 100644
--- a/State.hs
+++ b/State.hs
@@ -1,3 +1,18 @@
module State where
+import List
+
+import User
+
+data State = State {
+ channel :: String,
+ line :: String,
+ users :: [User]
+ } deriving (Show, Read)
+
+stateNumUsers :: State -> Int
+stateNumUsers state = length $ users state
+
+stateSortedUsers :: State -> [User]
+stateSortedUsers state = sort $ users state