Array#map
, Array#filter
create a new array and hence effectively iterating over the array (or creating new array).
Whereas in rust, python, java, c#, etc. such expression chain will iterate only once.
In most cases this is irrelevant and we do not have to care about that. However in some cases the performance hit could be a deal breaker to leverage the function api of the Array
class.
How do you mitigate this? So you have any preference on a library enabling lazy evaluation for functional expression?