|
|
|
|
|
by snackbroken
76 days ago
|
|
Map and Filter are nice because they let you reason locally about a single element in isolation. Reduce(Fold) forces you to reason globally about intermediate results. Reduce also forces you to conjure up a "zero" value of the relevant type, which isn't usually difficult but it does constitute some extra mental overhead. |
|
It's always worthwhile to consider what the result will be when you pass in an empty list.