mirror of
https://github.com/apple/swift-async-algorithms
synced 2026-11-24 04:17:52 +00:00
The doc comments for the exclusive reductions overloads stated that the returned sequence is "the initial value followed by the reduced elements". That does not match the behavior: the iterator pulls a base element before emitting anything, so the first emitted element is the result of combining the initial value with the first base element, and the initial value is never emitted. For an empty base sequence the result is empty rather than a single-element sequence containing the initial value. This is the behavior the existing tests already pin down, and changing it would be source-breaking, so this corrects the documentation to match. Updates all four exclusive overloads (throwing and non-throwing, value and into:) and adds empty-base tests covering the now-documented edge case. The inclusive reductions and the DocC Reductions guide already describe the actual behavior and are left unchanged.