summaryrefslogtreecommitdiff
path: root/libraries/ghc-prim/GHC/Classes.hs
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ghc-prim/GHC/Classes.hs')
-rw-r--r--libraries/ghc-prim/GHC/Classes.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/libraries/ghc-prim/GHC/Classes.hs b/libraries/ghc-prim/GHC/Classes.hs
index 18662ad539..299a8720a9 100644
--- a/libraries/ghc-prim/GHC/Classes.hs
+++ b/libraries/ghc-prim/GHC/Classes.hs
@@ -32,7 +32,8 @@ module GHC.Classes(
Eq(..), eqInt, neInt,
Ord(..), gtInt, geInt, leInt, ltInt, compareInt, compareInt#,
(&&), (||), not,
- divInt#, modInt#
+ divInt#, modInt#,
+ thenCmp
) where
-- GHC.Magic is used in some derived instances
@@ -296,6 +297,12 @@ not :: Bool -> Bool
not True = False
not False = True
+-- This is used by the derived code for Ord, so put it here
+thenCmp :: Ordering -> Ordering -> Ordering
+LT `thenCmp` _ = LT
+EQ `thenCmp` y = y
+GT `thenCmp` _ = GT
+
------------------------------------------------------------------------
-- These don't really belong here, but we don't have a better place to