Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-26 Thread Dave Abrahams via swift-evolution
on Fri May 06 2016, Kevin Ballard wrote: > On Fri, May 6, 2016, at 07:33 PM, Dave Abrahams via swift-evolution wrote: >> >> on Fri May 06 2016, Kevin Ballard wrote: >> >> > On Fri, May 6, 2016, at 06:05 PM, Dave Abrahams via

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-26 Thread Dave Abrahams via swift-evolution
on Fri May 06 2016, Kevin Ballard wrote: > As I said to Chris in an off-list email, unfold() was actually the > function that I was the most excited about in the proposal, because it > allows for a very elegant solution to a variety of looping needs, > especially now

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Kevin Ballard via swift-evolution
On Fri, May 6, 2016, at 07:33 PM, Dave Abrahams via swift-evolution wrote: > > on Fri May 06 2016, Kevin Ballard wrote: > > > On Fri, May 6, 2016, at 06:05 PM, Dave Abrahams via swift-evolution wrote: > >> > >> on Fri May 06 2016, Kevin Ballard

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Kevin Ballard via swift-evolution
On Fri, May 6, 2016, at 06:15 PM, Dave Abrahams via swift-evolution wrote: > > on Fri May 06 2016, Matthew Johnson wrote: > > >> On May 6, 2016, at 7:30 PM, Dave Abrahams via swift-evolution > >> wrote: > >> > >> > >> on Fri May 06 2016,

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Kevin Ballard via swift-evolution
On Fri, May 6, 2016, at 06:05 PM, Dave Abrahams via swift-evolution wrote: > > on Fri May 06 2016, Kevin Ballard wrote: > > > On Fri, May 6, 2016, at 05:31 PM, Kevin Ballard wrote: > >> On Fri, May 6, 2016, at 05:19 PM, Dave Abrahams via swift-evolution wrote: > >> >

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Matthew Johnson via swift-evolution
> On May 6, 2016, at 8:15 PM, Dave Abrahams via swift-evolution > wrote: > > > on Fri May 06 2016, Matthew Johnson > wrote: > >>> On May 6, 2016, at 7:30 PM, Dave Abrahams via swift-evolution >>>

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Dave Abrahams via swift-evolution
on Fri May 06 2016, Erica Sadun wrote: > On May 6, 2016, at 6:27 PM, Dave Abrahams via swift-evolution > wrote: > > on Thu May 05 2016, Erica Sadun > wrote: > > On May 4, 2016, at 5:50 PM, Chris

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Dave Abrahams via swift-evolution
on Fri May 06 2016, Matthew Johnson wrote: >> On May 6, 2016, at 7:30 PM, Dave Abrahams via swift-evolution >> wrote: >> >> >> on Fri May 06 2016, Cole Campbell wrote: >> >>> I don't know if it's considered

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Chris Lattner via swift-evolution
On May 6, 2016, at 6:00 PM, Erica Sadun via swift-evolution wrote: > That aside, the prevailing sentiment is to rename reduce to `fold` and > partner it with `unfold`. > (I personally prefer Chris's `sequence` because I think it better reflects > how more Swift users

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Dave Abrahams via swift-evolution
on Fri May 06 2016, Kevin Ballard wrote: > On Fri, May 6, 2016, at 05:31 PM, Kevin Ballard wrote: >> On Fri, May 6, 2016, at 05:19 PM, Dave Abrahams via swift-evolution wrote: >> > >> > on Wed May 04 2016, Chris Lattner wrote: >> > >> > >

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Chris Lattner via swift-evolution
> On May 6, 2016, at 8:54 AM, David Hart wrote: > > Chris, as many people seem to be currently in favour of renaming reduce to > fold to support unfold, should be write a proposal, or can the modification > be accepted with less formality? We would *definitely* have to

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Erica Sadun via swift-evolution
On May 6, 2016, at 6:27 PM, Dave Abrahams via swift-evolution wrote: > > > on Thu May 05 2016, Erica Sadun > wrote: > >> On May 4, 2016, at 5:50 PM, Chris Lattner via swift-evolution >>

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Matthew Johnson via swift-evolution
> On May 6, 2016, at 7:30 PM, Dave Abrahams via swift-evolution > wrote: > > > on Fri May 06 2016, Cole Campbell wrote: > >> I don't know if it's considered too late at this point to rename 'reduce', >> but >> I'll add an enthusiastic

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Dave Abrahams via swift-evolution
on Fri May 06 2016, Cole Campbell wrote: > I don't know if it's considered too late at this point to rename 'reduce', but > I'll add an enthusiastic +1 to renaming it to 'fold' and adding 'unfold'. > 'Fold' > is just as obvious a name as 'reduce', IMO (actually I

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Kevin Ballard via swift-evolution
On Fri, May 6, 2016, at 05:31 PM, Kevin Ballard wrote: > On Fri, May 6, 2016, at 05:19 PM, Dave Abrahams via swift-evolution wrote: > > > > on Wed May 04 2016, Chris Lattner wrote: > > > > > Proposal link: > > >

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Kevin Ballard via swift-evolution
On Fri, May 6, 2016, at 05:19 PM, Dave Abrahams via swift-evolution wrote: > > on Wed May 04 2016, Chris Lattner wrote: > > > Proposal link: > > https://github.com/apple/swift-evolution/blob/master/proposals/0045-scan-takewhile-dropwhile.md > > > > Hello Swift

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Dave Abrahams via swift-evolution
on Thu May 05 2016, David Hart wrote: > If we are discussing naming changes to reduce, here's my personal opinion: > > * When I first encountered it, I understood exactly what it did because I knew > that term of art. If it was named sequence, I would have been >

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Dave Abrahams via swift-evolution
on Thu May 05 2016, Erica Sadun wrote: > On May 4, 2016, at 5:50 PM, Chris Lattner via swift-evolution > wrote: > > Proposal link: > > https://github.com/apple/swift-evolution/blob/master/proposals/0045-scan-takewhile-dropwhile.md

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Dave Abrahams via swift-evolution
on Wed May 04 2016, Chris Lattner wrote: > Proposal link: > https://github.com/apple/swift-evolution/blob/master/proposals/0045-scan-takewhile-dropwhile.md > > Hello Swift Community, > > The review of SE-0045: "Add scan, prefix(while:), drop(while:), and > unfold to

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Kevin Ballard via swift-evolution
On Fri, May 6, 2016, at 02:23 PM, Dave Abrahams via swift-evolution wrote: > > on Fri May 06 2016, Kevin Ballard wrote: > > > One idea that came out of the core team discussion was something like: > > > > sequence(from: 0) { $0 += 42 } > > > > Since it

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Dave Abrahams via swift-evolution
on Fri May 06 2016, Kevin Ballard wrote: > One idea that came out of the core team discussion was something like: > > sequence(from: 0) { $0 += 42 } > > Since it returns a sequence. > > It just occurred to me that, if we follow existing naming conventions,

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Kevin Ballard via swift-evolution
On Thu, May 5, 2016, at 01:39 PM, Chris Lattner via swift-evolution wrote: > >> On May 5, 2016, at 1:03 PM, Erica Sadun wrote: >> >> On May 4, 2016, at 5:50 PM, Chris Lattner via swift-evolution > evolut...@swift.org> wrote: >>> >>> Proposal link: >>>

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread David Hart via swift-evolution
Chris, as many people seem to be currently in favour of renaming reduce to fold to support unfold, should be write a proposal, or can the modification be accepted with less formality? > On 06 May 2016, at 15:11, Matthew Johnson wrote: > > > > Sent from my iPad > >

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Matthew Johnson via swift-evolution
Sent from my iPad > On May 6, 2016, at 1:29 AM, David Hart via swift-evolution > wrote: > > If we are discussing naming changes to reduce, here's my personal opinion: > > * When I first encountered it, I understood exactly what it did because I > knew that term

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Gmail via swift-evolution
I would also be happy with ‘fold’/‘unfold’. The term of art argument applies to fold in the same way it does for ‘reduce’. Otherwise (if we stick with ‘reduce’) I find both ‘induce’ and ‘expand’ to be good names. I can also suggest ‘accumulate’. In each of these cases I prefer the local

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread Cole Campbell via swift-evolution
I don't know if it's considered too late at this point to rename 'reduce', but I'll add an enthusiastic +1 to renaming it to 'fold' and adding 'unfold'. 'Fold' is just as obvious a name as 'reduce', IMO (actually I even prefer it). I think changing it now with other source-breaking changes is

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-06 Thread David Hart via swift-evolution
If we are discussing naming changes to reduce, here's my personal opinion: * When I first encountered it, I understood exactly what it did because I knew that term of art. If it was named sequence, I would have been confused. * If we are discussing name changes, I'd personally vote to change it

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-05 Thread Patrick Smith via swift-evolution
Or new AnySequence constructors? So the sequence can be generated more than once. let a = AnySequence(from: 1){ $0 * 2 }.prefix(10) print(Array(a)) // [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] let b = AnySequence(from: 10){ $0 == 0 ? nil : $0 - 1 } print(Array(b)) // [10, 9, 8, 7, 6,

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-05 Thread Brent Royal-Gordon via swift-evolution
> One idea that came out of the core team discussion was something like: > >sequence(from: 0) { $0 += 42 } > > Since it returns a sequence. It definitely occurred to me that this was kind of just a way to construct a generic iterator. Maybe a new AnyIterator (I believe there is such a

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-05 Thread Matthew Johnson via swift-evolution
Sent from my iPhone > On May 5, 2016, at 3:40 PM, Erica Sadun via swift-evolution > wrote: > > >>> On May 5, 2016, at 2:39 PM, Chris Lattner wrote: >>> >>> >>> On May 5, 2016, at 1:03 PM, Erica Sadun wrote: >>>

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-05 Thread Erica Sadun via swift-evolution
> On May 5, 2016, at 2:39 PM, Chris Lattner wrote: > >> >> On May 5, 2016, at 1:03 PM, Erica Sadun > > wrote: >> >> On May 4, 2016, at 5:50 PM, Chris Lattner via swift-evolution >>

Re: [swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-05 Thread Erica Sadun via swift-evolution
On May 4, 2016, at 5:50 PM, Chris Lattner via swift-evolution wrote: > > Proposal link: > https://github.com/apple/swift-evolution/blob/master/proposals/0045-scan-takewhile-dropwhile.md > > Sequence.prefix(while:) & Sequence.drop(while:) - These are *accepted* as >

[swift-evolution] [Accepted with modifications] SE-0045: Add scan, prefix(while:), drop(while:), and unfold to the stdlib

2016-05-04 Thread Chris Lattner via swift-evolution
Proposal link: https://github.com/apple/swift-evolution/blob/master/proposals/0045-scan-takewhile-dropwhile.md Hello Swift Community, The review of SE-0045: "Add scan, prefix(while:), drop(while:), and unfold to the stdlib" ran from April 28...May 3, 2016. A subset of the proposal is