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

Jikka.Core.Language.Util

Synopsis

Documentation

mapExprM' :: Monad m => ([(VarName, Type)] -> Expr -> m Expr) -> ([(VarName, Type)] -> Expr -> m Expr) -> [(VarName, Type)] -> Expr -> m Expr Source #

mapExprM` substitutes exprs using given two functions, which are called in pre-order and post-order.

mapExprToplevelExprM' :: Monad m => ([(VarName, Type)] -> Expr -> m Expr) -> ([(VarName, Type)] -> Expr -> m Expr) -> [(VarName, Type)] -> ToplevelExpr -> m ToplevelExpr Source #

mapExprProgramM' :: Monad m => ([(VarName, Type)] -> Expr -> m Expr) -> ([(VarName, Type)] -> Expr -> m Expr) -> Program -> m Program Source #

mapExprM :: Monad m => ([(VarName, Type)] -> Expr -> m Expr) -> [(VarName, Type)] -> Expr -> m Expr Source #

mapExprM is a wrapper of mapExprM`. This function works in post-order.

mapExprProgramM :: Monad m => ([(VarName, Type)] -> Expr -> m Expr) -> Program -> m Program Source #

mapExpr :: ([(VarName, Type)] -> Expr -> Expr) -> [(VarName, Type)] -> Expr -> Expr Source #

isConstantTimeExpr :: Expr -> Bool Source #

isConstantTimeExpr checks whether given exprs are suitable to propagate.

replaceLenF :: MonadError Error m => VarName -> VarName -> Integer -> Expr -> m Expr Source #

replaceLenF replaces len(f) in an expr with i + k. * This assumes that there are no name conflicts.