Open sorawee opened 8 months ago
This rule already exists, but it doesn't fire when the function given to map
isn't a lambda because there isn't a good candidate for a variable name to pick automatically. The fusion seems valuable enough that it might be worth doing it anyway in that case and just using v
as the variable for everything.
E.g.
is equivalent to
More generally:
is equivalent to
But the latter doesn't create an intermediate data structure, so it's better.
Probably can do the same with
filter
.