diff options
author | Joachim Breitner <mail@joachim-breitner.de> | 2021-10-20 17:39:41 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-10-20 17:50:54 -0400 |
commit | f6f245152bb90de811213b4f724c9bf2f52a602b (patch) | |
tree | 1bac9c8a64cf07565c3c7baaa80af7dd3835d2e6 | |
parent | 268857af24c57156c14a5ddf98f23417763ca9dd (diff) | |
download | haskell-f6f245152bb90de811213b4f724c9bf2f52a602b.tar.gz |
instance Ord Name: Do not repeat default methods
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.hs | 6 |
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 |