Commits

Tony Morris committed 8f3b9d5

next/prev for cycling through ranks

Comments (0)

Files changed (1)

 rank' :: (Enum a) => Int -> a
 rank' = toEnum . subtract 2
 
+next :: Rank -> Rank
+next Ace = Two
+next x = succ x
+
+prev :: Rank -> Rank
+prev Two = Ace
+prev x = succ x
+
 instance Arbitrary Rank where
   arbitrary = elements [Two ..]