summaryrefslogtreecommitdiff
path: root/libraries/ghc-prim/GHC/Classes.hs
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2015-09-09 10:18:18 +0200
committerJoachim Breitner <mail@joachim-breitner.de>2015-09-09 10:18:18 +0200
commit25d72fbf45903da0b65fccfd3853c7a7ecc06b57 (patch)
treea10105ab1515c118b13d6d709353660be2f4fc2a /libraries/ghc-prim/GHC/Classes.hs
parentc07fd1dc37aae27a118fafd482dab52ba4946cb3 (diff)
downloadhaskell-wip/T10858.tar.gz
Move thenCmp to GHC.Classeswip/T10858
as we need to derive code already that, and that happens before GHC.Base.
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