Skip to content

Commit 2aa035e

Browse files
xperiandriclaude
andcommitted
docs: HashSet and ISet in the changelog and the collection table
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent c6ccc85 commit 2aa035e

4 files changed

Lines changed: 31 additions & 3 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
* The `FSharp.Collections.Immutable.Option.FlatList` and `FSharp.Collections.Immutable.Tuple.FlatList` modules repeat the
1616
functions that use value options or struct tuples with options and reference tuples.
1717
* The `FlatListBuilder` module works on the builder of a flat list, and `flatList { }` builds a flat list.
18+
* `HashSet` has every function of the FSharp.Core `Set` module that applies to a hash set, with its semantics, argument
19+
order and exceptions, plus `builder`, `builderWithComparer`, `choose`, `clear`, `comparer`, `emptyWithComparer`,
20+
`ofBuilder`, `ofSeqWithComparer`, `overlaps`, `setEquals`, `symmetricDifference`, `toBuilder`, `tryGetValue` and
21+
`withComparer`.
22+
* The `ISet` module works on any `IImmutableSet<'T>` with the functions of `HashSet` that need neither a creation nor a
23+
comparer; the transformations that keep the element type return the implementation of their input.
24+
* The `FSharp.Collections.Immutable.Option.HashSet`, `FSharp.Collections.Immutable.Tuple.HashSet`,
25+
`FSharp.Collections.Immutable.Option.ISet` and `FSharp.Collections.Immutable.Tuple.ISet` modules repeat `choose` and
26+
`tryGetValue` with options, and `partition` and `partitionWith` with reference tuples.
27+
* `hashSet { }` builds a hash set, and `HashSetCE` created with an equality comparer builds hash sets that compare with it.
1828

1929
### Changed
2030

@@ -24,6 +34,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2434
`voption`; the functions that return tuples return struct tuples.
2535
* `FlatList`: every function throws what the FSharp.Core `Array` function of the same name throws. `take` and `splitAt`
2636
throw for a count beyond the length, and a default `ImmutableArray` throws `ArgumentNullException`.
37+
* `HashSet`: `difference set1 set2` returns the elements of `set1` that are not in `set2`, as `Set.difference` does; it
38+
took its arguments in the reverse order before.
39+
* `HashSet`: `length` is renamed to `count`, `keyComparer` to `comparer` and `ofComparer` to `emptyWithComparer`.
40+
* `HashSet`: `filter`, `partition` and the set algebra keep the comparer of their input, the set algebra that of the first
41+
set; `map`, `choose` and `partitionWith` compare with the default comparer of the result type. `filter` dropped the
42+
comparer before.
43+
* `HashSet`: `tryGetValue` returns `voption`, `choose` takes a function that returns `voption`, and `partition` and
44+
`partitionWith` return struct tuples.
45+
* `HashSet`: `unionMany` of an empty sequence returns an empty hash set, as `Set.unionMany` does, and every function throws
46+
`ArgumentNullException` for a `null` hash set, sequence or array.
2747

2848
### Removed
2949

@@ -32,6 +52,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3252
* `FlatList.removeAll`, `removeAllWith`, `removeRange`, `sortRange`, `sortRangeWith`, `sortRangeWithComparer` and `sub`,
3353
and the `ImmutableArray` module alias of `FlatList`.
3454
* The `Seq` module of conversions between the collections.
55+
* The `ISet<'T>` abbreviation of `IImmutableSet<'T>`, because it shadowed `System.Collections.Generic.ISet<'T>`: use
56+
`IImmutableSet<'T>` and the `ISet` module.
57+
* The `HashSetBuilder<'T>` abbreviation: use `HashSet<'T>.Builder`.
58+
* `HashSet.where`: use `filter`. `HashSet.pick`, `tryPick` and `vTryPick`: use `Seq.pick` and `Seq.tryPick`.
59+
`HashSet.builderWith`, which took a comparer despite its name: use `builderWithComparer`. The public `HashSet.check`.
3560

3661
## [1.0.0] - 2020-02-23
3762

‎README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ Please also join the [F# Open Source Group](http://fsharp.github.com)
1818
| `Queue` | `ImmutableQueue<'T>` | – |
1919
| `HashMap` | `ImmutableDictionary<'Key, 'Value>` | – |
2020
| `SortedMap` | `ImmutableSortedDictionary<'Key, 'Value>` | – |
21-
| `HashSet` | `ImmutableHashSet<'T>` | – |
21+
| `HashSet` | `ImmutableHashSet<'T>` | `hashSet { }` |
2222
| `SortedSet` | `ImmutableSortedSet<'T>` | – |
23+
| `ISet` | `IImmutableSet<'T>` | – |
2324
| `IIndexedSeq` | `IReadOnlyList<'T>` | – |
2425

2526
[Documentation](https://fsprojects.github.io/FSharp.Collections.Immutable/)

‎docsSrc/Explanations/Background.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ While F# has its own built-in immutable collections, System.Collections.Immutabl
3232
| `Queue` | `ImmutableQueue<'T>` | – |
3333
| `HashMap` | `ImmutableDictionary<'Key, 'Value>` | – |
3434
| `SortedMap` | `ImmutableSortedDictionary<'Key, 'Value>` | – |
35-
| `HashSet` | `ImmutableHashSet<'T>` | – |
35+
| `HashSet` | `ImmutableHashSet<'T>` | `hashSet { }` |
3636
| `SortedSet` | `ImmutableSortedSet<'T>` | – |
37+
| `ISet` | `IImmutableSet<'T>` | – |
3738
| `IIndexedSeq` | `IReadOnlyList<'T>` | – |
3839

3940
---

‎docsSrc/index.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ F# bindings for [System.Collections.Immutable](https://learn.microsoft.com/en-us
1414
| `Queue` | `ImmutableQueue<'T>` | – |
1515
| `HashMap` | `ImmutableDictionary<'Key, 'Value>` | – |
1616
| `SortedMap` | `ImmutableSortedDictionary<'Key, 'Value>` | – |
17-
| `HashSet` | `ImmutableHashSet<'T>` | – |
17+
| `HashSet` | `ImmutableHashSet<'T>` | `hashSet { }` |
1818
| `SortedSet` | `ImmutableSortedSet<'T>` | – |
19+
| `ISet` | `IImmutableSet<'T>` | – |
1920
| `IIndexedSeq` | `IReadOnlyList<'T>` | – |
2021

2122
---

0 commit comments

Comments
 (0)