De-orphan the Eq/Ord Integer instances
[ghc-base.git] / GHC / Classes.hs
index c1532f2..30f706a 100644 (file)
@@ -20,6 +20,7 @@
 module GHC.Classes where
 
 import GHC.Bool
+import GHC.Integer
 -- GHC.Magic is used in some derived instances
 import GHC.Magic ()
 import GHC.Ordering
@@ -96,6 +97,10 @@ instance Eq Char where
     (C# c1) == (C# c2) = c1 `eqChar#` c2
     (C# c1) /= (C# c2) = c1 `neChar#` c2
 
+instance  Eq Integer  where
+    (==) = eqInteger
+    (/=) = neqInteger
+
 -- | The 'Ord' class is used for totally ordered datatypes.
 --
 -- Instances of 'Ord' can be derived for any user-defined
@@ -184,6 +189,13 @@ instance Ord Char where
     (C# c1) <= (C# c2) = c1 `leChar#` c2
     (C# c1) <  (C# c2) = c1 `ltChar#` c2
 
+instance Ord Integer where
+    (<=) = leInteger
+    (>)  = gtInteger
+    (<)  = ltInteger
+    (>=) = geInteger
+    compare = compareInteger
+
 -- OK, so they're technically not part of a class...:
 
 -- Boolean functions