Re: [swift-evolution] Proposal: CollectionType.cycle property for an infinite sequence

2015-12-30 Thread plx via swift-evolution
> On Dec 29, 2015, at 6:38 PM, Dave Abrahams wrote: > > >> On Dec 29, 2015, at 3:39 PM, plx via swift-evolution >> > wrote: >> >>> >>> On Dec 29, 2015, at 1:17 PM, Kevin Ballard via swift-evolution >>>

Re: [swift-evolution] Proposal: CollectionType.cycle property for an infinite sequence

2015-12-29 Thread plx via swift-evolution
> On Dec 29, 2015, at 1:17 PM, Kevin Ballard via swift-evolution > wrote: > > On Tue, Dec 29, 2015, at 08:14 AM, plx via swift-evolution wrote: >> Personally I’d say this should be a -1 for standard-library inclusion. >> >> Swift’s not really built to handle

Re: [swift-evolution] Proposal: CollectionType.cycle property for an infinite sequence

2015-12-29 Thread Dave Abrahams via swift-evolution
> On Dec 27, 2015, at 11:35 PM, Developer via swift-evolution > wrote: > > +1. Stream support is long overdue. Could you define what you mean by “stream support?” Whatever it is, I doubt simply adding an infinitely-repeating sequence type is enough to get you

Re: [swift-evolution] Proposal: CollectionType.cycle property for an infinite sequence

2015-12-29 Thread Kevin Ballard via swift-evolution
On Tue, Dec 29, 2015, at 04:11 PM, Dave Abrahams wrote: > > > On Dec 27, 2015, at 11:20 PM, Kevin Ballard via swift-evolution > > wrote: > > > > ## Introduction > > > > Add a new property `cycle` to CollectionType that returns an infinite > > SequenceType that

Re: [swift-evolution] Proposal: CollectionType.cycle property for an infinite sequence

2015-12-29 Thread Dave Abrahams via swift-evolution
> On Dec 29, 2015, at 4:29 PM, Craig Cruden wrote: > >> Could you define what you mean by “stream support?” Whatever it is, I doubt >> simply adding an infinitely-repeating sequence type is enough to get you >> there. > > > I can guess — but it is only a guess. > >

Re: [swift-evolution] Proposal: CollectionType.cycle property for an infinite sequence

2015-12-29 Thread Craig Cruden via swift-evolution
I have never tried to implement a “stream” in Swift, so I am not sure if there is an easy way to do it…. but I don’t see a collection of type stream as I have in Scala. http://www.scala-lang.org/api/current/index.html#scala.collection.immutable.Stream

Re: [swift-evolution] Proposal: CollectionType.cycle property for an infinite sequence

2015-12-29 Thread Kevin Ballard via swift-evolution
On Tue, Dec 29, 2015, at 10:12 PM, Andrew Bennett wrote: > Hi Kevin, > > The issue I was seeing was because AnySequence uses the protocol > extension on SequenceType for its implementations of > filter/suffix/prefix etc. So I don't think it's taking into account > any implementations of those on

Re: [swift-evolution] Proposal: CollectionType.cycle property for an infinite sequence

2015-12-29 Thread Andrew Bennett via swift-evolution
Hi Kevin, The issue I was seeing was because AnySequence uses the protocol extension on SequenceType for its implementations of filter/suffix/prefix etc. So I don't think it's taking into account any implementations of those on the base sequence's type. The problem basically comes down to this:

[swift-evolution] Proposal: CollectionType.cycle property for an infinite sequence

2015-12-27 Thread Kevin Ballard via swift-evolution
## Introduction Add a new property `cycle` to CollectionType that returns an infinite SequenceType that yields the elements of the collection in a loop. ## Motivation It's sometimes useful to be able to have an infinite sequence. For example, `CollectionOfOne(x).cycle` could be used to have

Re: [swift-evolution] Proposal: CollectionType.cycle property for an infinite sequence

2015-12-27 Thread Developer via swift-evolution
+1. Stream support is long overdue. ~Robert Widmann 2015/12/28 2:20、Kevin Ballard via swift-evolution のメッセージ: > ## Introduction > > Add a new property `cycle` to CollectionType that returns an infinite > SequenceType that yields the elements of the collection in