summaryrefslogtreecommitdiff
path: root/Karma.hs
blob: 9093936df6a4837bdf8e6ede5b1c56b845719f2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)