Make DayOfWeek an instance of the Enum typeclass. Use your implementation of enum to make it also an instance of the Ord typeclass.
For Enum you must implement toEnum and fromEnum, and you'll get the rest of the elements for free:
class Enum a where succ :: a -> a pred :: a -> a toEnum :: Int -> a fromEnum :: a -> Int enumFrom :: a -> [a] enumFromThen :: a -> a -> [a] enumFromTo :: a -> a -> [a] enumFromThenTo :: a -> a -> a -> [a]
For Ord you must implement some of these functions. Can anyone tell me which ones are necessary?
class (Eq a) => Ord a where compare :: a -> a -> Ordering (<) :: a -> a -> Bool (<=) :: a -> a -> Bool (>) :: a -> a -> Bool (>=) :: a -> a -> Bool max :: a -> a -> a min :: a -> a -> a