git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #347 from garyb/elim-unused-fixities

Remove unused FixityDeclarations in DCE

commit1b8f713843b5258e12d7940bb7d38afa4891704b authorPhil Freeman <paf31@cantab.net> dateThu 3 Apr 2014, 12:51 (13 years ago) parentff0c4be2b2e371
1 file changed+3
src/Language/PureScript/DeadCodeElimination.hs+3
src/Language/PureScript/DeadCodeElimination.hs+3
@@ -86,6 +86,9 @@ isUsed :: ModuleName -> Graph -> (Key -> Maybe Vertex) -> [Vertex] -> Declaratio
8686isUsed moduleName graph vertexFor entryPointVertices (ValueDeclaration name _ _ _ _) =
8787 let Just v' = vertexFor (moduleName, Left name)
8888 in any (\v -> path graph v v') entryPointVertices
89+isUsed moduleName graph vertexFor entryPointVertices (FixityDeclaration _ name) =
90+ let Just v' = vertexFor (moduleName, Left $ Op name)
91+ in any (\v -> path graph v v') entryPointVertices
8992isUsed moduleName graph vertexFor entryPointVertices (DataDeclaration _ _ dctors) =
9093 any (\(pn, _) -> let Just v' = vertexFor (moduleName, Right pn)
9194 in any (\v -> path graph v v') entryPointVertices) dctors