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)