Skip to content

Commit 6309937

Browse files
xperiandriclaude
andcommitted
fixup! docs: HashSet and ISet in the changelog and the collection table
Two sentences that the `SortedSet` branch found missing in the `HashSet` bullets, after it verified that all eight mutating members of the BCL interfaces throw `NotSupportedException` on `ImmutableHashSet`: - The struct of `HashSet.forComparer` also replaces `ToImmutableHashSet(items, comparer)`. - The mutating members of the BCL interfaces, such as `ISet<T>.UnionWith` and `ICollection<T>.Add`, throw `NotSupportedException` on a hash set and have no function. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 59fef05 commit 6309937

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3939
* `HashSet.forComparer comparer` creates the `CustomComparerHashSet` struct, whose members `build`, `builder`, `empty`,
4040
`ofArray`, `ofList`, `ofReadOnlySpan`, `ofSeq`, `ofSpan` and `singleton` create hash sets and builders that compare
4141
with the comparer, as in `(HashSet.forComparer StringComparer.OrdinalIgnoreCase).ofSeq names`. They replace the BCL
42-
members `Create(comparer, ...)`, `CreateRange(comparer, items)` and `CreateBuilder(comparer)`. `ofSeq` also gives an
43-
existing hash set the comparer, as `WithComparer` does: the hash set itself comes back for the same comparer
44-
instance, and an equal but distinct instance rebuilds it. `WithComparer(null)` is `HashSet.ofSeq set`. A `null`
45-
comparer throws `ArgumentNullException`.
42+
members `Create(comparer, ...)`, `CreateRange(comparer, items)`, `ToImmutableHashSet(items, comparer)` and
43+
`CreateBuilder(comparer)`. `ofSeq` also gives an existing hash set the comparer, as `WithComparer` does: the hash set
44+
itself comes back for the same comparer instance, and an equal but distinct instance rebuilds it.
45+
`WithComparer(null)` is `HashSet.ofSeq set`. A `null` comparer throws `ArgumentNullException`.
4646
* `HashSet.add` and `remove` return the input itself when nothing changes, so a reference comparison of the input and
4747
the result tells whether `Add` changed anything, as the `bool` result of `Builder.Add` does. Hash sets have no builder
4848
module: `builder`, `toBuilder` and `ofBuilder` are `CreateBuilder`, `ToBuilder` and `ToImmutable`, and the builder is
49-
used directly.
49+
used directly. The mutating members of the BCL interfaces, such as `ISet<T>.UnionWith` and `ICollection<T>.Add`,
50+
throw `NotSupportedException` on a hash set and have no function.
5051
* `add`, `addRange`, `remove`, `removeRange`, `clear`, `update`, `filter` and `partition` of `HashSet` keep the comparer
5152
of their input, and the set algebra keeps the comparer of the first hash set; `map`, `choose` and `partitionWith`
5253
compare with the default comparer of the result type. Every function throws `ArgumentNullException` for a `null` hash

0 commit comments

Comments
 (0)