summaryrefslogtreecommitdiff
path: root/compiler/deSugar/Desugar.lhs
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2006-10-06 16:14:03 +0000
committersimonpj@microsoft.com <unknown>2006-10-06 16:14:03 +0000
commit3932b76369acda843a6c998449bf953a7cb2f5fc (patch)
tree50816c8fda8bb7f73537d864ce3370f445358835 /compiler/deSugar/Desugar.lhs
parent0ebf7478754e33020732fa2da4c0f4eedd618c6f (diff)
downloadhaskell-3932b76369acda843a6c998449bf953a7cb2f5fc.tar.gz
Comments and an import-trim
Diffstat (limited to 'compiler/deSugar/Desugar.lhs')
-rw-r--r--compiler/deSugar/Desugar.lhs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/deSugar/Desugar.lhs b/compiler/deSugar/Desugar.lhs
index dc0e124426..c2ee0a5a11 100644
--- a/compiler/deSugar/Desugar.lhs
+++ b/compiler/deSugar/Desugar.lhs
@@ -270,6 +270,9 @@ dsRule mod in_scope (L loc (HsRule name act vars lhs tv_lhs rhs fv_rhs))
lhs_names = fn_name : nameSetToList (exprsFreeNames args)
-- No need to delete bndrs, because
-- exprsFreeNames finds only External names
+
+ -- A rule is an orphan only if none of the variables
+ -- mentioned on its left-hand side are locally defined
orph = case filter (nameIsLocalOrFrom mod) lhs_names of
(n:ns) -> Just (nameOccName n)
[] -> Nothing