efficiency when the
result is a copy-on-write type, for example an Array or a Dictionary.</p>

<p>The <code>updateAccumulatingResult</code> closure is called sequentially with a
mutable accumulating value initialized to <code>initialResult</code> and each element
of the sequence. This example shows how to build a dictionary of letter
frequencies of a string.</p>

<pre><code class="language-swift">let letters = &quot;abracadabra&quot;
let letterCount = letters.reduce(into: [:]) { counts, letter in
    counts