X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FbasicTypes%2FNameSet.lhs;h=e60ea23d278e0b33f565d7e72262aadf7dd36685;hb=5664dcaca1117ac0ecf9188406e8539fc7f7fe78;hp=d0e55dec687b00c86b40a0181f9ede47568c74f3;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/compiler/basicTypes/NameSet.lhs b/compiler/basicTypes/NameSet.lhs index d0e55de..e60ea23 100644 --- a/compiler/basicTypes/NameSet.lhs +++ b/compiler/basicTypes/NameSet.lhs @@ -1,7 +1,7 @@ % +% (c) The University of Glasgow 2006 % (c) The GRASP/AQUA Project, Glasgow University, 1998 % -\section[NameSet]{@NameSets@} \begin{code} module NameSet ( @@ -28,7 +28,6 @@ import Name import UniqSet \end{code} - %************************************************************************ %* * \subsection[Sets of names} @@ -54,7 +53,7 @@ foldNameSet :: (Name -> b -> b) -> b -> NameSet -> b filterNameSet :: (Name -> Bool) -> NameSet -> NameSet intersectNameSet :: NameSet -> NameSet -> NameSet intersectsNameSet :: NameSet -> NameSet -> Bool -- True if non-empty intersection - -- (s1 `intersectsVarSet` s2) doesn't compute s2 if s1 is empty + -- (s1 `intersectsNameSet` s2) doesn't compute s2 if s1 is empty isEmptyNameSet = isEmptyUniqSet emptyNameSet = emptyUniqSet @@ -98,6 +97,7 @@ mkFVs :: [Name] -> FreeVars delFV :: Name -> FreeVars -> FreeVars delFVs :: [Name] -> FreeVars -> FreeVars +isEmptyFVs :: NameSet -> Bool isEmptyFVs = isEmptyNameSet emptyFVs = emptyNameSet plusFVs = unionManyNameSets @@ -148,14 +148,14 @@ plusDU = (++) duDefs :: DefUses -> Defs duDefs dus = foldr get emptyNameSet dus where - get (Nothing, u1) d2 = d2 - get (Just d1, u1) d2 = d1 `unionNameSets` d2 + get (Nothing, _u1) d2 = d2 + get (Just d1, _u1) d2 = d1 `unionNameSets` d2 duUses :: DefUses -> Uses -- Just like allUses, but defs are not eliminated duUses dus = foldr get emptyNameSet dus where - get (d1, u1) u2 = u1 `unionNameSets` u2 + get (_d1, u1) u2 = u1 `unionNameSets` u2 allUses :: DefUses -> Uses -- Collect all uses, regardless of @@ -187,4 +187,4 @@ findUses dus uses = rhs_uses `unionNameSets` uses | otherwise -- No def is used = uses -\end{code} \ No newline at end of file +\end{code}