git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Check binders during DCE
commit96992f14c218374e3b32a801547bb11690ad3208 authorGary Burgess <gary.burgess@gmail.com> dateFri 26 Dec 2014, 13:57 (12 years ago) parent501ea67
1 file changed+4−1
src/Language/PureScript/DeadCodeElimination.hs+4−1
src/Language/PureScript/DeadCodeElimination.hs+4−1
@@ -74,12 +74,15 @@ declarationsByModule (Module mn _ _ fs ds) =
7474--
7575dependencies :: Bind a -> [Key]
7676dependencies =
77− let (f, _, _, _) = everythingOnValues (++) (const []) values (const []) (const [])
77+ let (f, _, _, _) = everythingOnValues (++) (const []) values binders (const [])
7878 in nub . f
7979 where
8080 values :: Expr a -> [Key]
8181 values (Var _ (Qualified (Just mn) ident)) = [(mn, ident)]
8282 values _ = []
83+ binders :: Binder a -> [Key]
84+ binders (ConstructorBinder _ _ (Qualified (Just mn) ident) _) = [(mn, Ident $ runProperName ident)]
85+ binders _ = []
8386
8487-- |
8588-- Check whether a binding group is used.