Fix CodingStyle#Warnings URLs
[ghc-hetmet.git] / compiler / rename / RnHsSyn.lhs
index 6752218..4171e34 100644 (file)
@@ -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}