Utility operations to execute program transformations.
newtype ReWriter a
Constructor:
ReWriter
:: (VarIndex -> (a, [Step], VarIndex, Bool)) -> ReWriter a
Fields:
Known instances:
replace
:: Expr -> [Int] -> Expr -> Expr
Replace a subexpression in an expressions, i.e.,
replace e p w
implements e[w]_p
.
Returns the next unused variable index in an expression.
update
:: a -> (String, [Int], Expr) -> Int -> ReWriter a