File tree Expand file tree Collapse file tree 5 files changed +16
-11
lines changed Expand file tree Collapse file tree 5 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -29,12 +29,12 @@ extension Sequence {
29
29
public func chained <S : Sequence >(with other : S) -> Concatenation<Self , S>
30
30
where Element == S.Element
31
31
}
32
-
33
32
```
34
33
35
- The resulting ` Chain ` type is a sequence, with conditional conformance to the
36
- ` Collection ` , ` BidirectionalCollection ` , and ` RandomAccessCollection ` when both
37
- the first and second arguments conform.
34
+ The resulting ` Chain ` type is a sequence, with conditional conformance to
35
+ ` Collection ` , ` BidirectionalCollection ` , and ` RandomAccessCollection ` when both
36
+ the first and second arguments conform. ` Chain ` also conforms to
37
+ ` LazySequenceProtocol ` when the first argument conforms.
38
38
39
39
### Naming
40
40
Original file line number Diff line number Diff line change @@ -51,7 +51,8 @@ Since the `Combinations` type needs to store an array of the collection’s
51
51
indices and mutate the array to generate each permutation, ` Combinations ` only
52
52
has ` Sequence ` conformance. Adding ` Collection ` conformance would require
53
53
storing the array in the index type, which would in turn lead to copying the
54
- array at every index advancement.
54
+ array at every index advancement. ` Combinations ` does conform to
55
+ ` LazySequenceProtocol ` when the base type conforms.
55
56
56
57
### Complexity
57
58
Original file line number Diff line number Diff line change @@ -33,10 +33,12 @@ extension Collection {
33
33
```
34
34
35
35
The new ` Cycle ` type is a sequence only, given that the ` Collection ` protocol
36
- design makes infinitely large types impossible/impractical. Note that despite
37
- its name, the returned ` FlattenSequence ` will always have ` Collection `
38
- conformance, and will have ` BidirectionalCollection ` conformance when called on
39
- a bidirectional collection.
36
+ design makes infinitely large types impossible/impractical. ` Cycle ` also
37
+ conforms to ` LazySequenceProtocol ` when the base type conforms.
38
+
39
+ Note that despite its name, the returned ` FlattenSequence ` will always have
40
+ ` Collection ` conformance, and will have ` BidirectionalCollection ` conformance
41
+ when called on a bidirectional collection.
40
42
41
43
### Complexity
42
44
Original file line number Diff line number Diff line change @@ -30,5 +30,6 @@ extension Collection {
30
30
```
31
31
32
32
` Indexed ` scales from a collection up to a random-access collection, depending on
33
- its base type.
33
+ its base type. ` Indexed ` also conforms to ` LazySequenceProtocol ` when the base type
34
+ conforms.
34
35
Original file line number Diff line number Diff line change @@ -75,7 +75,8 @@ Since the `Permutations` type needs to store an array of the collection’s
75
75
indices and mutate the array to generate each permutation, ` Permutations ` only
76
76
has ` Sequence ` conformance. Adding ` Collection ` conformance would require
77
77
storing the array in the index type, which would in turn lead to copying the
78
- array at every index advancement.
78
+ array at every index advancement. ` Combinations ` does conform to
79
+ ` LazySequenceProtocol ` when the base type conforms.
79
80
80
81
### Complexity
81
82
You can’t perform that action at this time.
0 commit comments