diff options
Diffstat (limited to 'HsBot/Karma.hs')
| -rw-r--r-- | HsBot/Karma.hs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/HsBot/Karma.hs b/HsBot/Karma.hs new file mode 100644 index 0000000..939b782 --- /dev/null +++ b/HsBot/Karma.hs @@ -0,0 +1,21 @@ +module HsBot.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) + |
