@@ -8,6 +8,7 @@ Maintainer : The Idris Community.
8{-# LANGUAGE DeriveDataTypeable, OverloadedStrings, StandaloneDeriving #-}
8{-# LANGUAGE DeriveDataTypeable, OverloadedStrings, StandaloneDeriving #-}
10module IRTS.JavaScript.LangTransforms( removeDeadCode
10module IRTS.JavaScript.LangTransforms( removeDeadCode
@@ -94,3 +95,15 @@ removeDeadCode dcls start =
94 remCons = removeUnusedBranches (getUsedConstructors used) used
95 remCons = removeUnusedBranches (getUsedConstructors used) used
95 in if Map.keys remCons == Map.keys dcls then remCons
96 in if Map.keys remCons == Map.keys dcls then remCons
96 else removeDeadCode remCons start
97 else removeDeadCode remCons start
100+globlToCon :: Map Name LDecl -> Map Name LDecl
104+ f :: Map Name LDecl -> LExp -> LExp
105+ f y x@(LV (Glob n)) =
106+ case Map.lookup n y of
107+ Just (LConstructor _ conId arity) -> LCon Nothing conId n []