|
|
|
|
|
by actsasbuffoon
3499 days ago
|
|
They're both parallelizable, but the second one is harder to automatically parallelize. There are guarantees about the way a map function works. It doesn't mutate its input, it only has access to one element at a time, you can't access the data structure you're building, etc. All of these traits are true of the imperative version as well, but it's a lot harder to write a program which understands that. Meanwhile, you know that's how map and filter work, so it's trivially easy to know that those guarantees hold. |
|
Can't be done.