summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/TyCo/Rep.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Core/TyCo/Rep.hs')
-rw-r--r--compiler/GHC/Core/TyCo/Rep.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/GHC/Core/TyCo/Rep.hs b/compiler/GHC/Core/TyCo/Rep.hs
index 5931d8c94a..5215b5ce2e 100644
--- a/compiler/GHC/Core/TyCo/Rep.hs
+++ b/compiler/GHC/Core/TyCo/Rep.hs
@@ -252,7 +252,13 @@ instance Outputable Type where
data TyLit
= NumTyLit Integer
| StrTyLit FastString
- deriving (Eq, Ord, Data.Data)
+ deriving (Eq, Data.Data)
+
+instance Ord TyLit where
+ compare (NumTyLit _) (StrTyLit _) = LT
+ compare (StrTyLit _) (NumTyLit _) = GT
+ compare (NumTyLit x) (NumTyLit y) = compare x y
+ compare (StrTyLit x) (StrTyLit y) = uniqCompareFS x y
instance Outputable TyLit where
ppr = pprTyLit