Those look like Java loops, and I don't recall them being much more than sugar over a for loop (although presumably they're implementing some Iterable class and apply to more than just arrays).
Either way, like most things in functional programming, it's often about restricting your functions so that they're easier to reason about. There's nothing special about the map function really in any pragmatic sense except when used in conjunction with the other features a good language affords.
I'm also curious if you think something like:
listOfListsmap : List (List Int) -> List (List Int)
listOfListsmap =
(List.map << List.map) (\n -> n + 1)
is easier to understand at a quick glance than a rough equivalent using those loops above:
collections.forEach(x -> {
// anything could happen here to x before the inner loop processes it
// and since we're probably dealing with mutable variables, the inner loop can
presumably access things I put here (which may or may not be a problem, but is something you have to think about)
x.forEach(y -> {
// do something with y, we can do anything with x *and* y here
y = y + 1;
}
}
knowing that << is the composition function.