Immutable sets based on binary trees, where elements are ordered by F# generic comparison. By default comparison is the F# structural comparison function or uses implementations of the IComparable interface on element values.
See the Set module for further operations on sets. All members of this class are thread-safe and may be used concurrently from multiple threads.
Constructor | Description |
|
Example
|
Instance member | Description |
![]() ![]() ![]() ![]() ![]() ![]() A useful shortcut for Set.add. Note this operation produces a new set and does not mutate the original set. The new set will share many storage nodes with the original. See the Set module for further operations on sets.
Example
The sample evaluates to the following output: The new set is: set [1; 2]
|
|
Full Usage:
this.Contains
Parameters:
'T
-
The value to check.
Returns: bool
True if the set contains value .
|
Example
The sample evaluates to the following output: Does the set contain 1? false
|
|
Example
The sample evaluates to the following output: The set has 3 elements
|
|
Example
The sample evaluates to the following output: Is the set empty? false
|
|
![]() ![]() ![]() ![]() ![]() ![]() Evaluates to "true" if all elements of the first set are in the second, and at least one element of the second is not in the first.
Example
The sample evaluates to the following output: Is set [1; 2; 3] a proper subset of set [1; 2; 3; 4]? true
|
|
![]() ![]() ![]() ![]() ![]() ![]() Evaluates to "true" if all elements of the second set are in the first, and at least one element of the first is not in the second.
Example
The sample evaluates to the following output: Is set [1; 2; 3] a proper superset of set [1; 2; 3; 4]? false
|
|
Example
The sample evaluates to the following output: Is set [1; 2; 3] a subset of set [1; 2; 3; 4]? true
|
|
Example
The sample evaluates to the following output: Is set [1; 2; 3] a superset of set [1; 2; 3; 4]? false
|
Full Usage:
this.MaximumElement
Returns: 'T
|
Example
The sample evaluates to the following output: MaximumElement: 3
|
Full Usage:
this.MinimumElement
Returns: 'T
|
Example
The sample evaluates to the following output: MinimumElement: 1
|
Full Usage:
this.Remove
Parameters:
'T
-
The value to remove from the set.
Returns: Set<'T>
The result set.
|
![]() ![]() ![]() ![]() ![]() ![]() A useful shortcut for Set.remove. Note this operation produces a new set and does not mutate the original set. The new set will share many storage nodes with the original. See the Set module for further operations on sets.
Example
The sample evaluates to the following output: The new set is: set [2]
|
Static member | Description |
|
Example
The sample evaluates to the following output: The new set is: set [1; 2; 3; 4]
|
|
Example
The sample evaluates to the following output: The new set is: set [1]
|