zephyr-0.5.3: Zephyr, tree-shaking for the PureScript language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.PureScript.DCE

Synopsis

Documentation

data Level Source #

Constructors

Error 
Warning 

Instances

Instances details
Show Level Source # 
Instance details

Defined in Language.PureScript.DCE.Errors

runForeignModuleDeadCodeElimination :: [Ident] -> [JSModuleItem] -> [JSModuleItem] Source #

Filter export statements in a foreign module. This is not 100% safe. It might remove declarations that are used somewhere in the foreign module (for example by using eval).

evaluate :: [Module Ann] -> [Module Ann] Source #

Evaluate expressions in a module:

  • Data.Eq.eq of two literals
  • Data.Array.index on a literal array
  • Object accessors
  • Semigroup operations (Array, String, Unit)
  • Semiring operations (Unit, Unit, Unit)

Keep stack of local identifiers from let and case expressions, ignoring the ones that are comming from abstractions (we are not reducing applications).

runDeadCodeElimination Source #

Arguments

:: [Qualified Ident]

entry points used to build the graph of dependencies across module boundaries

-> [Module Ann]

modules to dce

-> [Module Ann]

dead code eliminated modules

Dead code elimination of a list of modules module

runBindDeadCodeElimination :: Bind Ann -> Bind Ann Source #

Dead code elimination of local identifiers in Binds, which detects and removes unused bindings.