Skip to content

Commit a9fd89e

Browse files
committed
Addressing mail list discussion comments
- s/AnyCollection/AnySequence in introduction section - adding a note in proposed solution, that SubSequence.SubSequence does not have to be '== SubSequence', but simply has to be a sequence of the same underlying element type.
1 parent db62a33 commit a9fd89e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

proposals/0014-constrained-AnySequence.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ its initializer should have extra constraints.
1212

1313
## Motivation
1414

15-
At the moment `AnyCollection` does not delegate calls to `SequenceType` protocol
15+
At the moment `AnySequence` does not delegate calls to `SequenceType` protocol
1616
methods to the underlying base sequence, which results in dynamic downcasts in
1717
places where this behavior is needed (see default implementations of
1818
`SequenceType.dropFirst` or `SequenceType.prefix`). Besides, and this is even
@@ -76,7 +76,10 @@ public struct AnySequence<Element> : SequenceType {
7676

7777
These constraints, in fact, should be applied to `SequenceType` protocol itself
7878
(although, that is not currently possible), as we expect every `SequenceType`
79-
implementation to satisfy them already.
79+
implementation to satisfy them already. Worth mentioning that technically
80+
`S.SubSequence.SubSequence == S.SubSequence` does not have to be this strict,
81+
as any sequence with the same element type would do, but that is currently not
82+
representable.
8083

8184
## Impact on existing code
8285

0 commit comments

Comments
 (0)