purescript-0.8.0.0: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell98

Language.PureScript.CodeGen.JS.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

Documentation

optimize :: (Monad m, MonadReader Options m, Applicative m, MonadSupply m) => JS -> m JS Source

Apply a series of optimizer passes to simplified Javascript code