Jikka-5.0.11.2: A transpiler from Python to C++ for competitive programming
Copyright(c) Kimiyuki Onaka 2021
LicenseApache License 2.0
Maintainerkimiyuki95@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Jikka.Core.Convert.BubbleLet

Description

 
Synopsis

Documentation

run :: (MonadAlpha m, MonadError Error m) => Program -> m Program Source #

run moves let-exprs in lambdas passed to higher-order functions to the outer of the higher-order functions.

Examples

Before:

map (fun x -> let c = 12345 in c * x) xs

After:

let c = 12345 in map (fun x -> c * x) xs

internal rules