You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of trying to convince people that they should always lift the complex computation on Y out of the loop, it's not so difficult to do it automatically.
This would need to be an optimization performed before lambda-lifiting. It would identify maximial non-immediate subexpressions in the lambda-body which don't contain the lambda-bound variables and lift them out.
Since the above is syntactic sugar for:
all \{x := f x (doSomethingComplex Y)} X
the transformation would optimize it to
all (let y := doSomethingComplex Y in \{x := f x y}) X
In the optimized version, doSomethingComplex is performed only once before passing the lambda-function to all.
The text was updated successfully, but these errors were encountered:
lukaszcz
changed the title
Lift complex expression that don't use the lambda-bound variable out of the lambdas
Lift complex expression that don't use the lambda-bound variables out of the lambdas
Sep 13, 2024
I've noticed that people often write things like
Instead of trying to convince people that they should always lift the complex computation on
Y
out of the loop, it's not so difficult to do it automatically.This would need to be an optimization performed before lambda-lifiting. It would identify maximial non-immediate subexpressions in the lambda-body which don't contain the lambda-bound variables and lift them out.
Since the above is syntactic sugar for:
the transformation would optimize it to
In the optimized version,
doSomethingComplex
is performed only once before passing the lambda-function toall
.The text was updated successfully, but these errors were encountered: