summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2021-10-20 17:39:41 +0200
committerJoachim Breitner <mail@joachim-breitner.de>2021-10-20 17:41:17 +0200
commitde4d1e2664133f5f63e3d9c2a5d3106d40785170 (patch)
tree22f09565e91020f3c31b24e793f770cdb10f1c1f
parentd73131b9315abf39fc2d307b1c59bf8edd1e43ac (diff)
downloadhaskell-wip/joachim/Ord-Name-instance.tar.gz
instance Ord Name: Do not repeat default methodswip/joachim/Ord-Name-instance
it is confusing to see what looks like it could be clever code, only to see that it does precisely the same thing as the default methods. Cleaning this up, to spare future readers the confusion.
-rw-r--r--compiler/GHC/Types/Name.hs6
1 files changed, 1 insertions, 5 deletions
diff --git a/compiler/GHC/Types/Name.hs b/compiler/GHC/Types/Name.hs
index c2b76b1bfd..527f8da0fe 100644
--- a/compiler/GHC/Types/Name.hs
+++ b/compiler/GHC/Types/Name.hs
@@ -552,11 +552,7 @@ instance Eq Name where
-- For a deterministic lexicographic ordering, use `stableNameCmp`.
instance Ord Name where
- a <= b = case (a `compare` b) of { LT -> True; EQ -> True; GT -> False }
- a < b = case (a `compare` b) of { LT -> True; EQ -> False; GT -> False }
- a >= b = case (a `compare` b) of { LT -> False; EQ -> True; GT -> True }
- a > b = case (a `compare` b) of { LT -> False; EQ -> False; GT -> True }
- compare a b = cmpName a b
+ compare = cmpName
instance Uniquable Name where
getUnique = nameUnique