Skip to content

Commit 59fef05

Browse files
xperiandriclaude
andcommitted
fixup! docs: HashSet and ISet in the changelog and the collection table
The published 1.0.0 package has only the type abbreviations `ISet<'T>`, `SortedSet<'T>` and `HashSet<'T>` for the sets: no `HashSet` or `SortedSet` module, no `HashSetBuilder<'T>` abbreviation (checked in the metadata and the signature data of both target frameworks, and `sets.fs` of the `v1.0.0` tag agrees). The `Changed` and `Removed` entries name only what 1.0.0 had or did, so: - `Removed` keeps the `ISet<'T>` abbreviation. The entries for the `HashSetBuilder<'T>` abbreviation and for `where`, `pick`, `tryPick`, `vTryPick`, `check`, `ofComparer`, `ofSeqWithComparer`, `builderWithComparer` and `builderWith` go: they were names of the unreleased `HashSet` module of `main`. - The eight `HashSet` entries of `Changed` go (`difference` and `union`, the functions that took a sequence, the order of the elements that stay, the compiled name of the module, `length` and `keyComparer`, `filter` and the set algebra, `tryGetValue`, `unionMany` and the null checks): they compared the module with `main`. - What the dropped entries said about the new module and is still true moves to `Added`: which functions keep the comparer, the null checks, `unionMany` of nothing, the `voption` and struct tuple results, the BCL members that take a sequence, and which equal element stays. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 5620b46 commit 59fef05

1 file changed

Lines changed: 15 additions & 31 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
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
4949
used directly.
50+
* `add`, `addRange`, `remove`, `removeRange`, `clear`, `update`, `filter` and `partition` of `HashSet` keep the comparer
51+
of their input, and the set algebra keeps the comparer of the first hash set; `map`, `choose` and `partitionWith`
52+
compare with the default comparer of the result type. Every function throws `ArgumentNullException` for a `null` hash
53+
set, sequence or array. `unionMany` of an empty sequence returns an empty hash set, as `Set.unionMany` does.
54+
`tryGetValue` returns a `voption`, `choose` takes a function that returns a `voption`, and `partition` and
55+
`partitionWith` return struct tuples.
56+
* The set algebra and the relations of `HashSet` take hash sets, as the `Set` functions do. The BCL members that take a
57+
sequence map as follows: `Union` and `Except` are `addRange` and `removeRange`, `Overlaps` and `IsSupersetOf` are
58+
`Seq.exists` and `Seq.forall` with `contains`, and the others take `HashSet.ofSeq elements`, or
59+
`(HashSet.forComparer (HashSet.comparer set)).ofSeq elements` to give the elements the comparer of the first hash set.
60+
* The element that stays when the comparer finds two elements equal follows the BCL: `union` and `addRange` keep the
61+
element of the first hash set, `intersect` keeps the elements of the second one, and the creation functions keep the
62+
first element of their input. `isProperSuperset` is the exception: it counts the elements of the second hash set that
63+
the comparer of the first one finds equal once, as the documentation of `IsProperSupersetOf` says, where the member
64+
counts each of them.
5065
* The `ISet` module works on any `IImmutableSet<'T>` with the functions of `HashSet` that need neither a creation nor a
5166
comparer, `addRange` and `removeRange` included; the transformations that keep the element type return the
5267
implementation of their input.
@@ -69,29 +84,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6984
* `FlatList.sub` has the meaning of `Array.sub`: `sub array startIndex count` returns `count` elements from `startIndex`.
7085
It was `sub start stop list`.
7186
* The nested `FlatList.Builder` module is now the `FlatListBuilder` module.
72-
* `HashSet`: `difference set1 set2` returns the elements of `set1` that are not in `set2`, as `Set.difference` does. In
73-
1.0.0 `difference values set` removed a sequence from a hash set: that is `removeRange values set` now, with the same
74-
order of the arguments. `union set values` of 1.0.0 is `addRange values set`.
75-
* `HashSet`: `union`, `intersect`, `isSubset`, `isProperSubset`, `isSuperset` and `isProperSuperset` took a sequence as
76-
the second argument in 1.0.0 and take a hash set now, as the `Set` functions do: pass `HashSet.ofSeq elements`, or
77-
`(HashSet.forComparer (HashSet.comparer set)).ofSeq elements` to give the elements the comparer of the first hash
78-
set. The BCL members that take a sequence map the same way: `Union` and `Except` are `addRange` and `removeRange`,
79-
`Overlaps` and `IsSupersetOf` are `Seq.exists` and `Seq.forall` with `contains`, and the others take `ofSeq` of the
80-
sequence.
81-
* `HashSet`: the element that stays when the comparer finds two elements equal follows the BCL: `union` and `addRange`
82-
keep the element of the first hash set, `intersect` keeps the elements of the second one, and the creation functions
83-
keep the first element of their input. `isProperSuperset` counts the elements of the second hash set that the
84-
comparer of the first one finds equal once, where `ImmutableHashSet.IsProperSupersetOf` counts each of them, against
85-
its documentation.
86-
* `HashSet`: the compiled name of the module is `HashSet`, which C# callers see; it was `ImmutableHashSetModule`.
87-
* `HashSet`: `length` is renamed to `count` and `keyComparer` to `comparer`.
88-
* `HashSet`: `filter`, `partition` and the set algebra keep the comparer of their input, the set algebra that of the first
89-
set; `map`, `choose` and `partitionWith` compare with the default comparer of the result type. `filter` dropped the
90-
comparer before.
91-
* `HashSet`: `tryGetValue` returns `voption`, `choose` takes a function that returns `voption`, and `partition` and
92-
`partitionWith` return struct tuples.
93-
* `HashSet`: `unionMany` of an empty sequence returns an empty hash set, as `Set.unionMany` does, and every function throws
94-
`ArgumentNullException` for a `null` hash set, sequence or array.
9587

9688
### Removed
9789

@@ -111,14 +103,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
111103
* `FlatList.removeRange`: use `removeManyAt`.
112104
* The `ISet<'T>` abbreviation of `IImmutableSet<'T>`, because it shadowed `System.Collections.Generic.ISet<'T>`: use
113105
`IImmutableSet<'T>` and the `ISet` module.
114-
* The `HashSetBuilder<'T>` abbreviation: use `HashSet<'T>.Builder`.
115-
* `HashSet.where`: use `filter`. `HashSet.pick`, `tryPick` and `vTryPick`, which the FSharp.Core `Set` module does not
116-
have: use `HashSet.toSeq set |> Seq.pick chooser`, or `Seq.tryPick` and `ValueOption.ofOption`. The public
117-
`HashSet.check`.
118-
* `HashSet.ofComparer comparer`, `ofSeqWithComparer comparer elements` and `builderWithComparer comparer`: use
119-
`(HashSet.forComparer comparer).empty`, `(HashSet.forComparer comparer).ofSeq elements` and
120-
`(HashSet.forComparer comparer).builder ()`. `HashSet.builderWith`, whose argument bound to the comparer overload of
121-
the BCL member, has no replacement: hash sets have no capacity.
122106

123107
## [1.0.0] - 2020-02-23
124108

0 commit comments

Comments
 (0)