I was trying to define a data type for rock paper scissors and came up with something like this:
data Hand = P | S | R deriving (Show, Eq)
instance Ord Hand where
compare R P = LT
compare P R = GT
compare R S = GT
compare S R = LT
compare P S = LT
compare S P = GT
compare _ _ = EQ
While writing all that I was wondering if there's any way to define the data type to just have it derive Ord and then specify that
compare R P = LT and compare P R = GT instead of having to write all the comparisons by hand, for three elements it's okay but it would get tedious with each added element.