X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Frename%2FRnHsSyn.lhs;h=4171e34c6dea403a4e5046fc2cf727296747c798;hb=d6a7aff83282d537e160264604d6703e2698600e;hp=6752218b29e3a1bc2ca46aeb7f0c5f5a7e8e55a7;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/compiler/rename/RnHsSyn.lhs b/compiler/rename/RnHsSyn.lhs index 6752218..4171e34 100644 --- a/compiler/rename/RnHsSyn.lhs +++ b/compiler/rename/RnHsSyn.lhs @@ -4,6 +4,13 @@ \section[RnHsSyn]{Specialisations of the @HsSyn@ syntax for the renamer} \begin{code} +{-# OPTIONS -w #-} +-- The above warning supression flag is a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings +-- for details + module RnHsSyn( -- Names charTyCon_name, listTyCon_name, parrTyCon_name, tupleTyCon_name, @@ -74,6 +81,7 @@ extractHsTyNames ty `unionNameSets` getl ty) `minusNameSet` mkNameSet (hsLTyVarNames tvs) + get (HsDocTy ty _) = getl ty extractHsTyNames_s :: [LHsType Name] -> NameSet extractHsTyNames_s tys = foldr (unionNameSets . extractHsTyNames) emptyNameSet tys @@ -86,6 +94,8 @@ extractHsCtxtTyNames (L _ ctxt) -- so don't mention the IP names extractHsPredTyNames (HsClassP cls tys) = unitNameSet cls `unionNameSets` extractHsTyNames_s tys +extractHsPredTyNames (HsEqualP ty1 ty2) + = extractHsTyNames ty1 `unionNameSets` extractHsTyNames ty2 extractHsPredTyNames (HsIParam n ty) = extractHsTyNames ty \end{code} @@ -127,9 +137,8 @@ conDeclFVs (L _ (ConDecl { con_qvars = tyvars, con_cxt = context, conResTyFVs ResTyH98 = emptyFVs conResTyFVs (ResTyGADT ty) = extractHsTyNames ty -conDetailsFVs (PrefixCon btys) = plusFVs (map bangTyFVs btys) -conDetailsFVs (InfixCon bty1 bty2) = bangTyFVs bty1 `plusFV` bangTyFVs bty2 -conDetailsFVs (RecCon flds) = plusFVs [bangTyFVs bty | (_, bty) <- flds] +conDetailsFVs :: HsConDeclDetails Name -> FreeVars +conDetailsFVs details = plusFVs (map bangTyFVs (hsConDeclArgTys details)) bangTyFVs bty = extractHsTyNames (getBangType bty) \end{code}