News for hackers. Stuff that matters.
Re:Loopless Programming by kragen on Saturday October 19, 2019 @09:45PM (#21301845)
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.

There are no comments on this comment yet.