X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FhsSyn%2FHsLit.lhs;h=7111cbde2becf30ac666277bfcc75a2d168814ba;hb=8fbccf0ef71cc22100d229dc09aecb0ae90deec0;hp=f75c0a7ab2d5c470a7c1379e375c3add48e9d133;hpb=01d54e8741ea99cfbeb96496b927be87d0657eac;p=ghc-hetmet.git diff --git a/ghc/compiler/hsSyn/HsLit.lhs b/ghc/compiler/hsSyn/HsLit.lhs index f75c0a7..7111cbd 100644 --- a/ghc/compiler/hsSyn/HsLit.lhs +++ b/ghc/compiler/hsSyn/HsLit.lhs @@ -41,21 +41,19 @@ data HsLit -- before the typechecker it's just an error value deriving( Eq ) -data HsOverLit name -- An overloaded literal - = HsIntegral Integer name -- Integer-looking literals; - -- The names is "fromInteger" - | HsFractional Rational name -- Frac-looking literals - -- The name is "fromRational" +data HsOverLit -- An overloaded literal + = HsIntegral Integer -- Integer-looking literals; + | HsFractional Rational -- Frac-looking literals -instance Eq (HsOverLit name) where - (HsIntegral i1 _) == (HsIntegral i2 _) = i1 == i2 - (HsFractional f1 _) == (HsFractional f2 _) = f1 == f2 +instance Eq HsOverLit where + (HsIntegral i1) == (HsIntegral i2) = i1 == i2 + (HsFractional f1) == (HsFractional f2) = f1 == f2 -instance Ord (HsOverLit name) where - compare (HsIntegral i1 _) (HsIntegral i2 _) = i1 `compare` i2 - compare (HsIntegral _ _) (HsFractional _ _) = LT - compare (HsFractional f1 _) (HsFractional f2 _) = f1 `compare` f2 - compare (HsFractional f1 _) (HsIntegral _ _) = GT +instance Ord HsOverLit where + compare (HsIntegral i1) (HsIntegral i2) = i1 `compare` i2 + compare (HsIntegral _) (HsFractional _) = LT + compare (HsFractional f1) (HsFractional f2) = f1 `compare` f2 + compare (HsFractional f1) (HsIntegral _) = GT \end{code} \begin{code} @@ -73,9 +71,9 @@ instance Outputable HsLit where ppr (HsIntPrim i) = integer i <> char '#' ppr (HsLitLit s _) = hcat [text "``", ptext s, text "''"] -instance Outputable (HsOverLit name) where - ppr (HsIntegral i _) = integer i - ppr (HsFractional f _) = rational f +instance Outputable HsOverLit where + ppr (HsIntegral i) = integer i + ppr (HsFractional f) = rational f \end{code}