<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Actually with Scala (and from what I gather from Big Data) — reduce and fold from the outside look like synonyms — BUT they are not. &nbsp;<div class=""><br class=""></div><div class="">inline from&nbsp;<a href="http://stackoverflow.com/questions/25158780/difference-between-reduce-and-foldleft-fold-in-functional-programming-particula" class="">http://stackoverflow.com/questions/25158780/difference-between-reduce-and-foldleft-fold-in-functional-programming-particula</a></div><div class=""><br class=""></div><div class=""><h2 style="margin: 0px 0px 0.5em; padding: 0px; border: 0px; line-height: 1.3; word-wrap: break-word; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; widows: 1; background-color: rgb(255, 255, 255);" class=""><span style="font-size: 12px;" class="">reduce vs foldLeft</span></h2><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class="">A big big difference, not mentioned in any other stackoverflow answer relating to this topic clearly, is that&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">reduce</code>&nbsp;should be given a&nbsp;<em style="margin: 0px; padding: 0px; border: 0px;" class="">commutative monoid</em>, i.e. an operation that is both commutative and associative. This means the operation can be parallelized.</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class="">This distinction is very important for Big Data / MPP / distributed computing, and the entire reason why&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">reduce</code>&nbsp;even exists. The collection can be chopped up and the&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">reduce</code>&nbsp;can operate on each chunk, then the&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">reduce</code>&nbsp;can operate on the results of each chunk - in fact the level of chunking need not stop one level deep. We could chop up each chunk too. This is why summing integers in a list is O(log N) if given an infinite number of CPUs.</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class="">If you just look at the signatures there is no reason for&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">reduce</code>&nbsp;to exist because you can achieve everything you can with&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">reduce</code>&nbsp;with a&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">foldLeft</code>. The functionality of&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">foldLeft</code>&nbsp;is a greater than the functionality of&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">reduce</code>.</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class=""><strong style="margin: 0px; padding: 0px; border: 0px;" class="">But</strong>&nbsp;you cannot parallelize a&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">foldLeft</code>, so its runtime is always O(N) (even if you feed in a commutative monoid). This is because it's assumed the operation is&nbsp;<em style="margin: 0px; padding: 0px; border: 0px;" class="">not</em>&nbsp;a commutative monoid and so the cumulated value will be computed by a series of sequential aggregations.</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class=""><code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">foldLeft</code>&nbsp;does not assume commutativity nor associativity. It's associativity that gives the ability to chop up the collection, and it's commutativity that makes cumulating easy because order is not important (so it doesn't matter which order to aggregate each of the results from each of the chunks). Strictly speaking commutativity is not necessary for parallelization, for example distributed sorting algorithms, it just makes the logic easier because you don't need to give your chunks an ordering.</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class="">If you have a look at the Spark documentation for&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">reduce</code>&nbsp;it specifically says "... commutative and associative binary operator"</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class=""><a href="http://spark.apache.org/docs/1.0.0/api/scala/index.html#org.apache.spark.rdd.RDD" style="margin: 0px; padding: 0px; border: 0px; text-decoration: none; cursor: pointer; color: rgb(0, 89, 153);" class="">http://spark.apache.org/docs/1.0.0/api/scala/index.html#org.apache.spark.rdd.RDD</a></p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class="">Here is proof that&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">reduce</code>&nbsp;is NOT just a special case of&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">foldLeft</code></p><pre class="prettyprinted lang-scala prettyprint" style="margin-top: 0px; padding: 5px; border: 0px; overflow: auto; width: auto; max-height: 600px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; color: rgb(57, 51, 24); word-wrap: normal; widows: 1; background-color: rgb(238, 238, 238);"><code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;" class=""><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;">scala</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">&gt;</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;"> </span><span class="kwd" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 139);">val</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;"> intParList</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">:</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;"> </span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">ParSeq</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">[</span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">Int</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">]</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;"> </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">=</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;"> </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">(</span><span class="lit" style="margin: 0px; padding: 0px; border: 0px; color: maroon;">1</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;"> to </span><span class="lit" style="margin: 0px; padding: 0px; border: 0px; color: maroon;">100000</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">).</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;">map</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">(</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;">_ </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">=&gt;</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;"> scala</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">.</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;">util</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">.</span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">Random</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">.</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;">nextInt</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">()).</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;">par

scala</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">&gt;</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;"> timeMany</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">(</span><span class="lit" style="margin: 0px; padding: 0px; border: 0px; color: maroon;">1000</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">,</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;"> intParList</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">.</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;">reduce</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">(</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;">_ </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">+</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;"> _</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">))</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;">
</span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">Took</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;"> </span><span class="lit" style="margin: 0px; padding: 0px; border: 0px; color: maroon;">462.395867</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;"> milli seconds

scala</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">&gt;</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;"> timeMany</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">(</span><span class="lit" style="margin: 0px; padding: 0px; border: 0px; color: maroon;">1000</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">,</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;"> intParList</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">.</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;">foldLeft</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">(</span><span class="lit" style="margin: 0px; padding: 0px; border: 0px; color: maroon;">0</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">)(</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;">_ </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">+</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;"> _</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: black;">))</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;">
</span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">Took</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;"> </span><span class="lit" style="margin: 0px; padding: 0px; border: 0px; color: maroon;">2589.363031</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: black;"> milli seconds</span></code></pre><h2 style="margin: 0px 0px 0.5em; padding: 0px; border: 0px; line-height: 1.3; font-weight: 400; word-wrap: break-word; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; widows: 1; background-color: rgb(255, 255, 255);" class=""><span style="font-size: 12px;" class="">reduce vs fold</span></h2><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class="">Now this is where it gets a little closer to the FP Category Theory roots, and a little trickier to explain.</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class="">There is no&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">fold</code>&nbsp;method in Scalding because under the (strict) Map Reduce programming model we cannot define&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">fold</code>&nbsp;because chunks do not have an ordering and&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">fold</code>&nbsp;only requires associativity, not commutativity. Spark&nbsp;<em style="margin: 0px; padding: 0px; border: 0px;" class="">does</em>&nbsp;have&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">fold</code>&nbsp;because its framework is a super-set of the Map Reduce programming model and can order its chunks. Well you can actually do this in Hadoop too, but Scalding doesn't seem to expose this functionality in the version I'm familiar with.</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class="">Put simply,&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">reduce</code>&nbsp;works without an order of cumulation,&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">fold</code>&nbsp;requires an order of cumulation and it is that order of cumulation that necessitates a zero value NOT the existence of the zero value that distinguishes them. Strictly speaking&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">reduce</code>&nbsp;<em style="margin: 0px; padding: 0px; border: 0px;" class="">should</em>&nbsp;work on an empty collection, because its zero value can by deduced by taking an arbitrary value&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">x</code>&nbsp;and then solving&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">x op y = x</code>, but that doesn't work with a non-commutative operation as there can exist a left and right zero value that are distinct (i.e.&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">x op y != y op x</code>). Of course Scala doesn't bother to work out what this zero value is as that would require doing some mathematics (which are probably uncomputable), so just throws an exception.</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both; color: rgb(34, 36, 38); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; widows: 1; background-color: rgb(255, 255, 255);" class="">This difference between&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">reduce*</code>&nbsp;and&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);" class="">fold*</code>&nbsp;is a FP historical convention and has its roots in Category Theory. I hope now this deep difference relating to parallelization will no longer go unnoticed :)</p><div class=""><br class=""></div></div><div class=""><br class=""></div><div class=""><br class=""><div class=""><div><blockquote type="cite" class=""><div class="">On 2016-02-06, at 2:30:01, Dave Abrahams via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><br class="">on Fri Feb 05 2016, Craig Cruden &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class=""><blockquote type="cite" class="">Swift reduce has a starting value and likely is just a fold, not a<br class="">reduce (at least when it is compared to Scala; not sure about when it<br class="">comes to big data).<br class=""></blockquote><br class="">IME fold and reduce have always been synonyms. &nbsp;Did I miss some memo?<br class=""><br class="">-- <br class="">-Dave<br class=""><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></div></blockquote></div><br class=""></div></div></body></html>