Sequence.Iterator.Element should become Sequence.Element
Sequence.SubSequence must be a Sequence
Sequence.SubSequence.Element must be same type as Sequence.Element
Collection.SubSequence.Index should be same type as Collection.Index
BidirectionalCollection.SubSequence should be a BidirectionalCollection
RandomAccessCollection.SubSequence should be a RandomAccessCollection
RangeReplaceableCollection.SubSequence should be a RangeReplaceableCollection
Collection.Indices should be a Collection
Collection.Indices.Index should be same type as Collection.Index
Collection.SubSequence.Indices should be same type as Collection.Indices
Enforcing these rules will massively simplify the writing of generic collections, including several instances in the standard library. See most entries marked FIXME(ABI) with (Associated Types with where clauses) or (Recursive Protocol Constraints) for examples.
The text was updated successfully, but these errors were encountered:
I believe that the following need more design discussion and should be split out into a separate proposal if we're going to do them:
Iterator should be a Sequence
Collection.SubSequence.Indices should be same type as Collection.Indices
Everything else listed above was already taken care of by @airspeedswift's work. The second of them, for example, means that all of the ``Default*Indices`` types need to use
airspeedswift commentedDec 19, 2016
Additional Detail from JIRA
md5: 6d5849c6136f3cb3c380bcd6362f6e00
Issue Description:
Once it is possible in the language (dependent on associated types with where clauses and recursive protocol constraints), the following rules should be enforced:
Iterator
should be aSequence
Sequence.Iterator.Element
should becomeSequence.Element
Sequence.SubSequence
must be aSequence
Sequence.SubSequence.Element
must be same type asSequence.Element
Collection.SubSequence.Index
should be same type asCollection.Index
BidirectionalCollection.SubSequence
should be aBidirectionalCollection
RandomAccessCollection.SubSequence
should be aRandomAccessCollection
RangeReplaceableCollection.SubSequence
should be aRangeReplaceableCollection
Collection.Indices
should be aCollection
Collection.Indices.Index
should be same type asCollection.Index
Collection.SubSequence.Indices
should be same type asCollection.Indices
Enforcing these rules will massively simplify the writing of generic collections, including several instances in the standard library. See most entries marked FIXME(ABI) with (Associated Types with where clauses) or (Recursive Protocol Constraints) for examples.
The text was updated successfully, but these errors were encountered: