summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-06-22 22:18:32 +0100
committerIan Lynagh <igloo@earth.li>2012-06-22 22:18:32 +0100
commitf1c81a73366ead49129e744832023335e311e066 (patch)
treea2fad524edd7a9176689d8038b66e494b2a39ca6
parent1a137b03472f3727ca7a6ab9621b28641c999301 (diff)
downloadhaskell-f1c81a73366ead49129e744832023335e311e066.tar.gz
Derive Eq Discr
We had effectively hand-written the instance instead
-rw-r--r--compiler/ghci/ByteCodeGen.lhs11
1 files changed, 2 insertions, 9 deletions
diff --git a/compiler/ghci/ByteCodeGen.lhs b/compiler/ghci/ByteCodeGen.lhs
index 230c09473a..0587ed6304 100644
--- a/compiler/ghci/ByteCodeGen.lhs
+++ b/compiler/ghci/ByteCodeGen.lhs
@@ -1305,7 +1305,7 @@ mkMultiBranch maybe_ncons raw_ways = do
-- shouldn't happen?
mkTree [val] range_lo range_hi
- | range_lo `eqAlt` range_hi
+ | range_lo == range_hi
= return (snd val)
| null defaults -- Note [CASEFAIL]
= do lbl <- getLabelBc
@@ -1386,14 +1386,6 @@ mkMultiBranch maybe_ncons raw_ways = do
Just n -> (0, fromIntegral n - 1)
Nothing -> (minBound, maxBound)
- (DiscrI i1) `eqAlt` (DiscrI i2) = i1 == i2
- (DiscrW w1) `eqAlt` (DiscrW w2) = w1 == w2
- (DiscrF f1) `eqAlt` (DiscrF f2) = f1 == f2
- (DiscrD d1) `eqAlt` (DiscrD d2) = d1 == d2
- (DiscrP i1) `eqAlt` (DiscrP i2) = i1 == i2
- NoDiscr `eqAlt` NoDiscr = True
- _ `eqAlt` _ = False
-
(DiscrI i1) `leAlt` (DiscrI i2) = i1 <= i2
(DiscrW w1) `leAlt` (DiscrW w2) = w1 <= w2
(DiscrF f1) `leAlt` (DiscrF f2) = f1 <= f2
@@ -1431,6 +1423,7 @@ data Discr
| DiscrD Double
| DiscrP Word16
| NoDiscr
+ deriving Eq
instance Outputable Discr where
ppr (DiscrI i) = int i