X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FhsSyn%2FHsDecls.lhs;h=3a610024a35beb222102eb33d60697775c9a52eb;hb=423d477bfecd490de1449c59325c8776f91d7aac;hp=930dcdcea5db64bdca75d339e66b6935511c6996;hpb=af5a215172aa3b964ece212f229bfee9f7c6b6b2;p=ghc-hetmet.git diff --git a/ghc/compiler/hsSyn/HsDecls.lhs b/ghc/compiler/hsSyn/HsDecls.lhs index 930dcdc..3a61002 100644 --- a/ghc/compiler/hsSyn/HsDecls.lhs +++ b/ghc/compiler/hsSyn/HsDecls.lhs @@ -40,12 +40,11 @@ import HscTypes ( DeprecTxt ) import CoreSyn ( RuleName ) import BasicTypes ( Activation(..) ) import ForeignCall ( CCallTarget(..), DNCallSpec, CCallConv, Safety, - CExportSpec(..)) + CExportSpec(..), CLabelString ) -- others: import FunDeps ( pprFundeps ) import Class ( FunDep ) -import CStrings ( CLabelString ) import Outputable import Util ( count ) import SrcLoc ( Located(..), unLoc ) @@ -306,9 +305,13 @@ data TyClDecl name tcdLName :: Located name, -- Type constructor tcdTyVars :: [LHsTyVarBndr name], -- Type variables tcdCons :: [LConDecl name], -- Data constructors - tcdDerivs :: Maybe (LHsContext name) + tcdDerivs :: Maybe [LHsType name] -- Derivings; Nothing => not specified -- Just [] => derive exactly what is asked + -- These "types" must be of form + -- forall ab. C ty1 ty2 + -- Typically the foralls and ty args are empty, but they + -- are non-empty for the newtype-deriving case } | TySynonym { tcdLName :: Located name, -- type constructor @@ -433,8 +436,7 @@ pp_tydecl pp_head pp_decl_rhs derivings pp_decl_rhs, case derivings of Nothing -> empty - Just ds -> hsep [ptext SLIT("deriving"), - ppr_hs_context (unLoc ds)] + Just ds -> hsep [ptext SLIT("deriving"), parens (interpp'SP ds)] ]) instance Outputable NewOrData where