X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FhsSyn%2FHsDecls.lhs;h=8078e7a2a86f1bc16334608161e87025179bb531;hb=108361d05dfb0aa37871c2c6a4ddec45a1b68010;hp=54075d4f92f88a2bceb42015191fae1cc0cc7c07;hpb=82c4d36b187955e3cedbb11cff92688747773456;p=ghc-hetmet.git diff --git a/compiler/hsSyn/HsDecls.lhs b/compiler/hsSyn/HsDecls.lhs index 54075d4..8078e7a 100644 --- a/compiler/hsSyn/HsDecls.lhs +++ b/compiler/hsSyn/HsDecls.lhs @@ -39,16 +39,14 @@ import HsPat ( HsConDetails(..), hsConArgs ) import HsImpExp ( pprHsVar ) import HsTypes import NameSet ( NameSet ) -import HscTypes ( DeprecTxt ) import CoreSyn ( RuleName ) -import Kind ( Kind, pprKind ) -import BasicTypes ( Activation(..) ) +import {- Kind parts of -} Type ( Kind, pprKind ) +import BasicTypes ( Activation(..), DeprecTxt ) import ForeignCall ( CCallTarget(..), DNCallSpec, CCallConv, Safety, CExportSpec(..), CLabelString ) -- others: -import FunDeps ( pprFundeps ) -import Class ( FunDep ) +import Class ( FunDep, pprFundeps ) import Outputable import Util ( count ) import SrcLoc ( Located(..), unLoc, noLoc ) @@ -451,7 +449,9 @@ isKindSigDecl (TyData {tcdKindSig = Just _, isKindSigDecl other = False -- definition of an instance of an indexed type -isIdxTyDecl = isJust . tcdTyPats +isIdxTyDecl tydecl + | isSynDecl tydecl || isDataDecl tydecl = isJust (tcdTyPats tydecl) + | otherwise = False \end{code} Dealing with names @@ -467,9 +467,7 @@ tyClDeclNames :: Eq name => TyClDecl name -> [Located name] -- We use the equality to filter out duplicate field names tyClDeclNames (TyFunction {tcdLName = name}) = [name] -tyClDeclNames (TySynonym {tcdLName = name, - tcdTyPats= Nothing}) = [name] -tyClDeclNames (TySynonym {} ) = [] -- type equation +tyClDeclNames (TySynonym {tcdLName = name}) = [name] tyClDeclNames (ForeignType {tcdLName = name}) = [name] tyClDeclNames (ClassDecl {tcdLName = cls_name, tcdSigs = sigs, tcdATs = ats})