purescript-0.11.4: 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(); ... }