Skip to content

Commit b5d5d82

Browse files
committed
Merge pull request #935 from EZ-NET/correct_document_set-type-parameter-name
[stdlib] [docs] Modify Set's type parameter name in comments.
2 parents 2187929 + cf8a733 commit b5d5d82

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

docs/proposals/Inplace.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,30 @@ In recent standard library design meetings about the proper API for
2323
sets, it was decided that the canonical ``Set`` interface should be
2424
written in terms of methods: [#operators]_ ::
2525

26-
struct Set<T> {
27-
public func contains(x: T) -> Bool // x ∈ A, A ∋ x
28-
public func isSubsetOf(b: Set<T>) -> Bool // A ⊆ B
29-
public func isStrictSubsetOf(b: Set<T>) -> Bool // A ⊂ B
30-
public func isSupersetOf(b: Set<T>) -> Bool // A ⊇ B
31-
public func isStrictSupersetOf(b: Set<T>) -> Bool // A ⊃ B
26+
struct Set<Element> {
27+
public func contains(x: Element) -> Bool // x ∈ A, A ∋ x
28+
public func isSubsetOf(b: Set<Element>) -> Bool // A ⊆ B
29+
public func isStrictSubsetOf(b: Set<Element>) -> Bool // A ⊂ B
30+
public func isSupersetOf(b: Set<Element>) -> Bool // A ⊇ B
31+
public func isStrictSupersetOf(b: Set<Element>) -> Bool // A ⊃ B
3232
...
3333
}
3434

3535
When we started to look at the specifics, however, we ran into a
3636
familiar pattern::
3737
3838
...
39-
public func union(b: Set<T>) -> Set<T> // A ∪ B
40-
public mutating func unionInPlace(b: Set<T>) // A ∪= B
39+
public func union(b: Set<Element>) -> Set<Element> // A ∪ B
40+
public mutating func unionInPlace(b: Set<Element>) // A ∪= B
4141

42-
public func intersect(b: Set<T>) -> Set<T> // A ∩ B
43-
public mutating func intersectInPlace(b: Set<T>) // A ∩= B
42+
public func intersect(b: Set<Element>) -> Set<Element> // A ∩ B
43+
public mutating func intersectInPlace(b: Set<Element>) // A ∩= B
4444

45-
public func subtract(b: Set<T>) -> Set<T> // A - B
46-
public mutating func subtractInPlace(b: Set<T>) // A -= B
45+
public func subtract(b: Set<Element>) -> Set<Element> // A - B
46+
public mutating func subtractInPlace(b: Set<Element>) // A -= B
4747

48-
public func exclusiveOr(b: Set<T>) -> Set<T> // A ⊕ B
49-
public mutating func exclusiveOrInPlace(b: Set<T>) // A ⊕= B
48+
public func exclusiveOr(b: Set<Element>) -> Set<Element> // A ⊕ B
49+
public mutating func exclusiveOrInPlace(b: Set<Element>) // A ⊕= B
5050

5151
We had seen the same pattern when considering the API for
5252
``String``, but in that case, there are no obvious operator

stdlib/public/SDK/Foundation/Foundation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ public func _convertNSSetToSet<T : Hashable>(s: NSSet?) -> Set<T> {
859859
return result!
860860
}
861861

862-
// Set<T> is conditionally bridged to NSSet
862+
// Set<Element> is conditionally bridged to NSSet
863863
extension Set : _ObjectiveCBridgeable {
864864
public static func _getObjectiveCType() -> Any.Type {
865865
return NSSet.self

stdlib/public/core/SetAlgebra.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
///
2323
/// > `a` **subsumes** `b` iff `([a] as Self).isSupersetOf([b])`
2424
///
25-
/// In many models of `SetAlgebraType` such as `Set<T>`, `a`
25+
/// In many models of `SetAlgebraType` such as `Set<Element>`, `a`
2626
/// *subsumes* `b` if and only if `a == b`, but that is not always the
2727
/// case. For example, option sets typically do not satisfy that
2828
/// property.

0 commit comments

Comments
 (0)