[swift-evolution] [Proposal] Remove eager `map` and `filter`

Tim Vermeulen tvermeulen at me.com
Sun Jun 19 17:52:36 CDT 2016


They can’t have `rethrows` either.

> > 1. Make sure that
> > 
> > Array(sequence.lazy.map { ... }) and sequence.map { ... }
> > Array(sequence.lazy.filter { ... }) and sequence.filter { ... }
> > 
> > are just as fast (with -O). "Fix lazy filter" proposal should help with this.
> > 
> > 2. Remove eager `map` and `filter`
> > 
> > 3. Remove `lazy` property
> > 
> > sequence.map { ... } will call lazy `map`, which is at least as fast as eager version
> > 
> > 4. Re-add `array` property to LazySequence
> > 
> > So that we can more easily convert to multipass sequence when needed.
> The first three Swift 1 betas were this way; then the lazy higher-order functions were changed to the current design, apparently because the all-lazy solution was confusing. (It's also worth noting that if we had only lazy versions, they could not take @noescape.) So I don't really think this is going to fly.
> 
> --
> Brent Royal-Gordon
> Architechies
> 
> 
> 
> 


More information about the swift-evolution mailing list