2 ms·
As the song says: All I ever wanted All I ever needed Is here In ML Loops are very Unnecessary map will work just as well But the
by kragen 7y ago
As the song says:
All I ever wanted
All I ever needed
Is here
In ML
Loops are very
Unnecessary
map will work just as well
But the function you pass to map or filter is called once for every sequence element, and reduce is nothing more than a foreach loop with explicit dataflow. So, although I agree that these are often better than a for loop, they are not the same thing as making the looping implicit.