From de4d1e2664133f5f63e3d9c2a5d3106d40785170 Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Wed, 20 Oct 2021 17:39:41 +0200 Subject: 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. --- compiler/GHC/Types/Name.hs | 6 +----- 1 file changed, 1 insertion(+), 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 -- cgit v1.2.1