Jikka-5.0.11.1: A transpiler from Python to C++ for competitive programming

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