[swift-evolution] [Review] SE-0045: Add scan, prefix(while:), drop(while:), and iterate to the stdlib
Kevin Ballard
kevin at sb.org
Sun May 1 13:50:06 CDT 2016
On Sun, May 1, 2016, at 04:13 AM, Brent Royal-Gordon wrote:
> > The proposal has been updated as per feedback from the core team (https://github.com/apple/swift-evolution/pull/275). This includes removing some last vestiges of Swift 2 naming as well as replacing `iterate(_:apply:)` with an overloaded function `unfold(_:applying:)`.
>
> The proposal says this:
>
> public func unfold<T, State>(_ initialState: State, applying: State -> (T, State)?) -> UnfoldSequence<T>
> public func unfold<T>(_ initialElement: T, apply: T -> T) -> UnfoldSequence<T>
>
> However, the comment implies that the second one should instead be this:
>
> public func unfold<T>(_ initialElement: T, applying: T -> T?) -> UnfoldSequence<T>
Oops, you're right, that was a mistake.
-Kevin
More information about the swift-evolution
mailing list