[swift-evolution] Proposal: Add scan, takeWhile, dropWhile, and iterate to the stdlib

Matthew Johnson matthew at anandabits.com
Mon Jan 11 19:25:04 CST 2016


> On Jan 11, 2016, at 7:21 PM, Jacob Bandes-Storch <jtbandes at gmail.com> wrote:
> 
> On Mon, Jan 11, 2016 at 5:18 PM, Matthew Johnson via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> 
> > On Jan 11, 2016, at 7:11 PM, Chris Lattner via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> >
> >
> >> On Jan 10, 2016, at 10:20 PM, Kevin Ballard via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> >>
> >> When the proposal is "we have a bunch of functions that match functions used in other languages, lets add a few more from the same category of functions that we missed", does there really need to be much explanation beyond "they're useful in the other languages that have them, they'd be useful for the same reasons in Swift”?
> >
> > I agree with what you’re saying, but the flip-side is: how do we scope what we accept into the standard library?  Just existing in some other language doesn’t mean that we should (automatically) accept new standard library functionality.
> >
> > I’m not arguing for or against your proposal, just trying to say that this rationale isn’t enough to justify adding things to the Swift standard library.
> 
> I agree.
> 
> Something I would like to see in the longer term is a set of libraries outside the standard library, but still going through a community review process for their evolution.  They would be given an “official” stamp of approval and would be hosted in community repos, but accessed via SPM rather than part of the core install.  This would allow us to keep the core library lean, but still offer a “batteries included” approach.
> 
> This might be a good place for things like Either, Deque, etc.

Deque sure and maybe Either.  But if we’re going to get an Either that is really a Result I would prefer to see that in the standard library and integrated with the error handling system (i.e. allow us to call a throwing function without `try` and receive a Result wrapping the return value, etc).

>  
> 
> Matthew
> 
> >
> > -Chris
> >
> > _______________________________________________
> > swift-evolution mailing list
> > swift-evolution at swift.org <mailto:swift-evolution at swift.org>
> > https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160111/12e2de14/attachment.html>


More information about the swift-evolution mailing list