X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FhsSyn%2FHsLit.lhs;h=0874dda85815c116abd60da8f908ffbc8bb92078;hb=ada48bbc7f6a43b2c042df629327902d82cea681;hp=bd125106e2d0e1c7177021d52d1a333bb050b5b0;hpb=ecdaf6bc29d23bd704df8c65442ee08032a585fc;p=ghc-hetmet.git diff --git a/compiler/hsSyn/HsLit.lhs b/compiler/hsSyn/HsLit.lhs index bd12510..0874dda 100644 --- a/compiler/hsSyn/HsLit.lhs +++ b/compiler/hsSyn/HsLit.lhs @@ -5,6 +5,8 @@ \section[HsLit]{Abstract syntax: source-language literals} \begin{code} +{-# LANGUAGE DeriveDataTypeable #-} + module HsLit where #include "HsVersions.h" @@ -14,7 +16,8 @@ import HsTypes (PostTcType) import Type ( Type ) import Outputable import FastString -import Ratio ( Rational ) + +import Data.Data \end{code} @@ -41,6 +44,7 @@ data HsLit -- (overloaded literals are done with HsOverLit) | HsFloatPrim Rational -- Unboxed Float | HsDoublePrim Rational -- Unboxed Double + deriving (Data, Typeable) instance Eq HsLit where (HsChar x1) == (HsChar x2) = x1==x2 @@ -63,11 +67,13 @@ data HsOverLit id -- An overloaded literal -- False <=> standard syntax ol_witness :: SyntaxExpr id, -- Note [Overloaded literal witnesses] ol_type :: PostTcType } + deriving (Data, Typeable) data OverLitVal = HsIntegral !Integer -- Integer-looking literals; | HsFractional !Rational -- Frac-looking literals | HsIsString !FastString -- String-looking literals + deriving (Data, Typeable) overLitType :: HsOverLit a -> Type overLitType = ol_type