diff options
| author | pb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157> | 2010-03-14 12:42:20 +0000 |
|---|---|---|
| committer | pb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157> | 2010-03-14 12:42:20 +0000 |
| commit | 3b090644f148acf856e925be59e6915ea524a3f8 (patch) | |
| tree | abff790b1c7e9fece7a65e084ecf763c2b2d0129 /User.hs | |
| parent | 1c16624f000070eb996b001cb9bf5a5bce18a7d8 (diff) | |
git-svn-id: https://ssl.buetow.org/repos/hsbot/trunk@25 9f8f72e9-4bf4-416e-b76e-7d4203597157
Diffstat (limited to 'User.hs')
| -rw-r--r-- | User.hs | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -0,0 +1,28 @@ +module User where + +import List + +import Karma +import 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) + |
