purescript-0.15.15: PureScript Programming Language Compiler

Safe Haskell | None
Language | Haskell2010

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

- magicDoEffect :: (AST -> AST) -> AST -> AST
- magicDoEff :: (AST -> AST) -> AST -> AST
- magicDoST :: (AST -> AST) -> AST -> AST
- inlineST :: AST -> AST

# Documentation

magicDoEffect :: (AST -> AST) -> AST -> AST #

magicDoEff :: (AST -> AST) -> AST -> AST #

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

E.g.

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

becomes

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

magicDoST :: (AST -> AST) -> AST -> AST #

inlineST :: AST -> AST #

Inline functions in the ST module