Eliminate compilation warnings.

Use deriving Enum, provide definitions for toRational and quotRem