X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FhsSyn%2FHsTypes.lhs;h=9b3930531e199835a286f372d3a66c97a7f6265a;hb=f278f0676579f67075033a4f9857715909c4b71e;hp=2e2eaabccf92f0fda7ab63a5a82cc6213ebc4be1;hpb=836b1e90821aacc9d1e09fe78085f911597274c8;p=ghc-hetmet.git diff --git a/compiler/hsSyn/HsTypes.lhs b/compiler/hsSyn/HsTypes.lhs index 2e2eaab..9b39305 100644 --- a/compiler/hsSyn/HsTypes.lhs +++ b/compiler/hsSyn/HsTypes.lhs @@ -6,6 +6,8 @@ HsTypes: Abstract syntax: user-defined types \begin{code} +{-# LANGUAGE DeriveDataTypeable #-} + module HsTypes ( HsType(..), LHsType, HsTyVarBndr(..), LHsTyVarBndr, @@ -42,6 +44,8 @@ import SrcLoc import StaticFlags import Outputable import FastString + +import Data.Data \end{code} @@ -76,6 +80,7 @@ data HsQuasiQuote id = HsQuasiQuote id -- The quasi-quoter SrcSpan -- The span of the enclosed string FastString -- The enclosed string + deriving (Data, Typeable) instance OutputableBndr id => Outputable (HsQuasiQuote id) where ppr = ppr_qq @@ -101,6 +106,7 @@ data HsBang = HsNoBang -- Only used as a return value for getBangStrictness, -- never appears on a HsBangTy | HsStrict -- ! | HsUnbox -- {-# UNPACK #-} ! (GHC extension, meaning "unbox") + deriving (Data, Typeable) instance Outputable HsBang where ppr (HsNoBang) = empty @@ -135,6 +141,7 @@ type LHsPred name = Located (HsPred name) data HsPred name = HsClassP name [LHsType name] -- class constraint | HsEqualP (LHsType name) (LHsType name)-- equality constraint | HsIParam (IPName name) (LHsType name) + deriving (Data, Typeable) type LHsType name = Located (HsType name) @@ -194,14 +201,15 @@ data HsType name | HsBangTy HsBang (LHsType name) -- Bang-style type annotations | HsRecTy [ConDeclField name] -- Only in data type declarations + deriving (Data, Typeable) -data HsExplicitFlag = Explicit | Implicit +data HsExplicitFlag = Explicit | Implicit deriving (Data, Typeable) data ConDeclField name -- Record fields have Haddoc docs on them = ConDeclField { cd_fld_name :: Located name, cd_fld_type :: LBangType name, cd_fld_doc :: Maybe LHsDocString } - + deriving (Data, Typeable) ----------------------- -- Combine adjacent for-alls. @@ -257,6 +265,7 @@ data HsTyVarBndr name -- *** NOTA BENE *** A "monotype" in a pragma can have -- for-alls in it, (mostly to do with dictionaries). These -- must be explicitly Kinded. + deriving (Data, Typeable) hsTyVarName :: HsTyVarBndr name -> name hsTyVarName (UserTyVar n _) = n