purescript-0.12.0: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell2010

Language.PureScript.CoreImp.Optimizer.MagicDo

Description

This module implements the "Magic Do" optimization, which inlines calls to return and bind for the Eff monad, as well as some of its actions.

Synopsis

Documentation

magicDo :: AST -> AST Source #

Inline type class dictionaries for >>= and return for the Eff monad

E.g.

Prelude[">>="](dict)(m1)(function(x) { return ...; })

becomes

function __do { var x = m1(); ... }

inlineST :: AST -> AST Source #

Inline functions in the ST module