ockquote>
<p>Complexity:
O(<em>k</em>), where <em>k</em> is the length of the result.</p>
</blockquote>
<h4>Declaration</h4><code class="language-swift">@inlinable public func prefix(while predicate: (Self.Element) throws -> Bool) rethrows -> [Self.Element]</code></div></div><div id="reduce-6df4b118cc55876e9cb07e09c5307a38" class="declaration"><a class="toggle-link" href="#comment-reduce-6df4b118cc55876e9cb07e09c5307a38">func reduce(_ initialResult: Result, _ nextPartialResult: (Result, Self.Element) throws