summaryrefslogtreecommitdiff
path: root/Karma.hs
diff options
context:
space:
mode:
authorpb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157>2010-03-14 12:42:20 +0000
committerpb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157>2010-03-14 12:42:20 +0000
commit3b090644f148acf856e925be59e6915ea524a3f8 (patch)
treeabff790b1c7e9fece7a65e084ecf763c2b2d0129 /Karma.hs
parent1c16624f000070eb996b001cb9bf5a5bce18a7d8 (diff)
git-svn-id: https://ssl.buetow.org/repos/hsbot/trunk@25 9f8f72e9-4bf4-416e-b76e-7d4203597157
Diffstat (limited to 'Karma.hs')
-rw-r--r--Karma.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/Karma.hs b/Karma.hs
new file mode 100644
index 0000000..9093936
--- /dev/null
+++ b/Karma.hs
@@ -0,0 +1,21 @@
+module Karma where
+
+data Karma = Karma {
+ karmaName :: String,
+ minPts :: Int,
+ minPerc :: Float
+ } deriving (Show, Read)
+
+instance Eq Karma where
+ x == y = (minPerc x) == (minPerc y) && (minPts x == minPts y)
+
+instance Ord Karma where
+ x > y
+ | (minPerc x) > (minPerc y) = True
+ | otherwise = (minPts x) > (minPts y)
+ x < y
+ | (minPerc x) < (minPerc y) = True
+ | otherwise = (minPts x) < (minPts y)
+ x >= y = not (x < y)
+ x <= y = not (x > y)
+