Another nice benefit of having pure functions is that you can divide a computation into multiple small parts, distribute the workload, and assemble the result. It is possible to do so for any mapping, filtering, and folding operations. The function used for folding needs to be monoidal as we will see. Functions for mapping and filtering have no particular constraint besides purity.
Mapping does not have any particular constraint beside a pure function. Say you have four cores, or computers; you will only need to follow these steps:
Split the array into four parts.
Send a part to each core to do the mapping.
Merge the results.
In this particular case, it might be slower than doing it on a single core as the merging operation adds an overhead. However, as soon as the computation takes longer, you are able to use more of the computing power at your disposal, and thus gain time.
Filtering operates in exactly the same way as mapping, except you send a predicate instead...