unction can be used to replace many instances of <code>AnyIterator</code> that
wrap a closure.</p>

<p>Example:</p>

<pre><code class="language-swift">// Interleave two sequences that yield the same element type
sequence(state: (false, seq1.makeIterator(), seq2.makeIterator()), next: { iters in
  iters.0 = !iters.0
  return iters.0 ? iters.1.next() : iters.2.next()
})</code></pre>

<p><strong><code>state</code>:</strong>  The initial state that will be passed to the closure.</p>

<p><strong><code>next</code