Commit 89e84d2
committed
Fix #6341: Revise purity checking
There is some confusion on terms that needs to be fixed.
Step 1: Make `SimplyPure apply to paths only.
The only point where it is used is in eta expansion to answer the question
whether in a partial application `f(e, _)` the expression `e` should be
lifted out, giving `{ val x = e; y => f(x, y) }` instead of `y => f(e, y)`.
With the change, closures and new expressions are never simply pure, so
are always lifted out. This can reduce the number of allocations, if the
lambda is applied several times.1 parent 22ba798 commit 89e84d2
1 file changed
+4
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
| 370 | + | |
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
385 | | - | |
| 384 | + | |
386 | 385 | | |
387 | 386 | | |
388 | 387 | | |
389 | 388 | | |
390 | 389 | | |
391 | 390 | | |
392 | | - | |
393 | | - | |
| 391 | + | |
| 392 | + | |
394 | 393 | | |
395 | 394 | | |
396 | 395 | | |
| |||
0 commit comments