summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Jakobi <simon.jakobi@gmail.com>2021-03-25 15:32:24 +0100
committerSimon Jakobi <simon.jakobi@gmail.com>2021-06-24 19:09:01 +0000
commit4466ab6e055ce826baf88db3b84b191c96bdebbf (patch)
treed1ebd00d32ff151608b6250209cacaa437f8932d
parent138b7a5775251c330ade870a0b8d1f5c4659e669 (diff)
downloadhaskell-wip/sjakobi/T8354-inlinable-ord.tar.gz
INLINABLE Ord methods (#8354)wip/sjakobi/T8354-inlinable-ord
-rw-r--r--libraries/ghc-prim/GHC/Classes.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/libraries/ghc-prim/GHC/Classes.hs b/libraries/ghc-prim/GHC/Classes.hs
index dfd707bd8c..a509319c0d 100644
--- a/libraries/ghc-prim/GHC/Classes.hs
+++ b/libraries/ghc-prim/GHC/Classes.hs
@@ -340,6 +340,13 @@ class (Eq a) => Ord a where
compare :: a -> a -> Ordering
(<), (<=), (>), (>=) :: a -> a -> Bool
max, min :: a -> a -> a
+ {-# INLINABLE compare #-}
+ {-# INLINABLE (<) #-}
+ {-# INLINABLE (<=) #-}
+ {-# INLINABLE (>) #-}
+ {-# INLINABLE (>=) #-}
+ {-# INLINABLE max #-}
+ {-# INLINABLE min #-}
compare x y = if x == y then EQ
-- NB: must be '<=' not '<' to validate the