on Sun May 01 2016, Brent Royal-Gordon <[email protected]> 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> > > I'm not sure I like having these be overloaded on only the return type > of the closure. Why not? It's a type, like anything else we might overload on. -- Dave _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
