purescript-0.15.15: PureScript Programming Language Compiler

Safe Haskell | None
Language | Haskell2010

Language.PureScript.CoreImp.Optimizer

Description

This module optimizes code in the simplified-JavaScript intermediate representation.

The following optimizations are supported:

- Collapsing nested blocks
- Tail call elimination
- Inlining of (>>=) and ret for the Eff monad
- Removal of unnecessary thunks
- Eta conversion
- Inlining variables
- Inline Prelude.($), Prelude.(#), Prelude.(++), Prelude.(!!)
- Inlining primitive JavaScript operators

Synopsis

- optimize :: MonadSupply m => [Text] -> [[AST]] -> m [[AST]]

# Documentation

optimize :: MonadSupply m => [Text] -> [[AST]] -> m [[AST]] #

Apply a series of optimizer passes to simplified JavaScript code