diff options
| author | pb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157> | 2010-03-28 10:42:32 +0000 |
|---|---|---|
| committer | pb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157> | 2010-03-28 10:42:32 +0000 |
| commit | 3911a1935535df6d65694339e7f7140714379b56 (patch) | |
| tree | 2f558d279e8ded4f35ea2de7016323845615f252 /HsBot/User.hs | |
| parent | 561aa6d45ed2c7dc6cd177bab5c31f6d8fccde66 (diff) | |
git-svn-id: https://ssl.buetow.org/repos/hsbot/trunk@45 9f8f72e9-4bf4-416e-b76e-7d4203597157
Diffstat (limited to 'HsBot/User.hs')
| -rw-r--r-- | HsBot/User.hs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/HsBot/User.hs b/HsBot/User.hs new file mode 100644 index 0000000..cd6d55f --- /dev/null +++ b/HsBot/User.hs @@ -0,0 +1,28 @@ +module HsBot.User where + +import List + +import HsBot.Karma +import HsBot.Render + +data User = User { + userName :: String, + userPts :: Int + } deriving (Show, Read) + +instance Eq User where + x == y = (userPts x) == (userPts y) + +instance Ord User where + x < y = (userPts x) < (userPts y) + x > y = (userPts x) > (userPts y) + x >= y = not (x < y) + x <= y = not (x > y) + +instance Render User where + render user = userName user ++ ": " ++ + (show $ userPts user) ++ "pts" + +userEquals :: User -> User -> Bool +userEquals x y = (userName x) == (userName y) + |
