scalar <code>g: U -&gt; real</code> is mapped to every element of a list of type <code>U[]</code>, <code>{ x1, x2, ... }</code> and all the results are accumulated,</p>
<p><code>g(x1) + g(x2) + ...</code></p>
<p>For efficiency reasons the reduce function doesn’t work with the element-wise evaluated function <code>g</code> itself, but instead works through evaluating partial sums, <code>f: U[] -&gt; real</code>, where:</p>
<pre><code>f({ x1 }) = g(x1)
f({ x1, x2 }) = g(x1) + g(x2)
f({ x1, x2, ... }) = g(x1