Skip to content

Commit 8bcada2

Browse files
xperiandriclaude
andcommitted
fixup! docs: SortedSet 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 `SortedSet` module, no `ImmutableSortedSetModule`, and no `SortedSetBuilder<'T>` abbreviation (compile probes and a byte scan of the 1.0.0 assembly). The `Changed` and `Removed` entries name only what 1.0.0 had or did, so: - `Removed` loses the entries for the `SortedSetBuilder<'T>` abbreviation and for `where`, `pick`, `tryPick`, `vTryPick`, `check`, `ofComparer`, `ofSeqWithComparer`, `builderWithComparer` and `builderWith`: they were names of the unreleased `SortedSet` module of `main`. The `SortedSet<'T>` abbreviation is unchanged, so it is no removal. - The eleven `SortedSet` entries of `Changed` go (the default comparer, `difference` and `union`, the functions that took a sequence, the element that stays, `isProperSuperset`, the compiled name of the module, `length` and `keyComparer`, `filter` and the set algebra, the creation functions, `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 order of F# generic comparison, the BCL members that take a sequence, and which equal element stays. - `Added` keeps the notes that the entries for `HashSet` lack: the mutating members of the BCL interfaces throw `NotSupportedException`, and `ToImmutableSortedSet` is one of the BCL members that the struct replaces. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent e38d558 commit 8bcada2

1 file changed

Lines changed: 21 additions & 38 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 21 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
100100
module: `builder`, `toBuilder` and `ofBuilder` are `CreateBuilder`, `ToBuilder` and `ToImmutable`, and the builder is
101101
used directly. The mutating members of the BCL interfaces, such as `ISet<T>.UnionWith` and `ICollection<T>.Add`, throw
102102
`NotSupportedException` on a sorted set and have no function.
103+
* `add`, `addRange`, `remove`, `removeRange`, `clear`, `update`, `filter` and `partition` of `SortedSet` keep the comparer
104+
of their input, and the set algebra keeps the comparer of the first sorted set. Every function throws
105+
`ArgumentNullException` for a `null` sorted set, sequence or array. `unionMany` of an empty sequence returns an empty
106+
sorted set, as `Set.unionMany` does. `tryGetValue` returns a `voption`, `choose` takes a function that returns a
107+
`voption`, and `partition` and `partitionWith` return struct tuples.
108+
* The functions of `SortedSet` that create a sorted set without a comparer, `builder`, `build`, `unionMany` of no sets,
109+
`map`, `choose`, `partitionWith` and `sortedSet { }` order with F# generic comparison, as `Set` does, where the BCL
110+
orders with `Comparer<'T>.Default`. A sorted set thus enumerates its elements in the order of the F# set of the same
111+
elements: strings, and tuples and other values that contain strings, compare ordinally instead of in the order of the
112+
current culture. `SortedSet.forComparer Comparer<'T>.Default` orders as the BCL does.
113+
* The set algebra and the relations of `SortedSet` take sorted sets, as the `Set` functions do. The BCL members that take
114+
a sequence map as follows: `Union` and `Except` are `addRange` and `removeRange`, `Overlaps` and `IsSupersetOf` are
115+
`Seq.exists` and `Seq.forall` with `contains`, and the others take `SortedSet.ofSeq elements`, or
116+
`(SortedSet.forComparer (SortedSet.comparer set)).ofSeq elements` to give the elements the comparer of the first sorted
117+
set.
118+
* The element that stays when the comparer finds two elements equal follows the BCL: `addRange` keeps the element of the
119+
sorted set, `union` keeps the element of the first sorted set, or of the larger one when both have the same comparer,
120+
`intersect` keeps the elements of the second one, and the creation functions keep the first element of their input,
121+
where `CreateRange` and `Create` with a span keep any of them. `isProperSuperset` is the exception: it counts the
122+
elements of the second sorted set that the comparer of the first one finds equal once, as the documentation of
123+
`IsProperSupersetOf` says, where the member counts each of them.
103124
* `SortedSet.minElement` and `maxElement` take the place of the properties `Min` and `Max`: they read the first and the
104125
last element in O(log n) and throw `ArgumentException` for an empty sorted set, as `Set.minElement` and
105126
`Set.maxElement` do, where the properties return `default`. `tryItem 0` and `tryItem (count - 1)` return a `voption`
@@ -124,36 +145,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
124145
* `FlatList.sub` has the meaning of `Array.sub`: `sub array startIndex count` returns `count` elements from `startIndex`.
125146
It was `sub start stop list`.
126147
* The nested `FlatList.Builder` module is now the `FlatListBuilder` module.
127-
* `SortedSet` (breaking): the sorted sets created without a comparer, the builders and the results of `map`, `choose` and
128-
`partitionWith` compare with F# generic comparison, as `Set` does, instead of `Comparer<'T>.Default`. A sorted set
129-
enumerates its elements in the order of the F# set of the same elements: strings, and tuples and other values that
130-
contain strings, compare ordinally instead of in the order of the current culture.
131-
`SortedSet.forComparer Comparer<'T>.Default` restores the order of 1.0.0.
132-
* `SortedSet`: `difference set1 set2` returns the elements of `set1` that are not in `set2`, as `Set.difference` does. In
133-
1.0.0 `difference values set` removed a sequence from a sorted set: that is `removeRange values set` now, with the same
134-
order of the arguments. `union set values` of 1.0.0 is `addRange values set`.
135-
* `SortedSet`: `union`, `intersect`, `isSubset`, `isProperSubset`, `isSuperset` and `isProperSuperset` took a sequence as
136-
the second argument in 1.0.0 and take a sorted set now, as the `Set` functions do: pass `SortedSet.ofSeq elements`, or
137-
`(SortedSet.forComparer (SortedSet.comparer set)).ofSeq elements` to give the elements the comparer of the first
138-
sorted set. The BCL members that take a sequence map the same way: `Union` and `Except` are `addRange` and
139-
`removeRange`, `Overlaps` and `IsSupersetOf` are `Seq.exists` and `Seq.forall` with `contains`, and the others take
140-
`ofSeq` of the sequence.
141-
* `SortedSet`: the element that stays when the comparer finds two elements equal follows the BCL: `addRange` keeps the
142-
element of the sorted set, `union` keeps the element of the first sorted set, or of the larger one when both have the
143-
same comparer, `intersect` keeps the elements of the second one, and the creation functions keep the first element of
144-
their input.
145-
* `SortedSet`: `isProperSuperset set1 set2` counts the elements of `set2` that the comparer of `set1` finds equal once, as
146-
the documentation of `ImmutableSortedSet.IsProperSupersetOf` says; it counted each of them before.
147-
* `SortedSet`: the compiled name of the module is `SortedSet`, which C# callers see; it was `ImmutableSortedSetModule`.
148-
* `SortedSet`: `length` is renamed to `count` and `keyComparer` to `comparer`.
149-
* `SortedSet`: `filter`, `partition` and the set algebra keep the comparer of their input, the set algebra that of the
150-
first set. `filter` dropped the comparer before.
151-
* `SortedSet`: `ofSeq` and `ofArray` keep the first of the elements that compare equal, as `Set.ofSeq` does, and so do
152-
the members of `CustomComparerSortedSet`; `ofSeq`, `ofArray` and `ofSeqWithComparer` could keep any of them before.
153-
* `SortedSet`: `tryGetValue` returns `voption`, `choose` takes a function that returns `voption`, and `partition` and
154-
`partitionWith` return struct tuples.
155-
* `SortedSet`: `unionMany` of an empty sequence returns an empty sorted set, as `Set.unionMany` does, and every function
156-
throws `ArgumentNullException` for a `null` sorted set, sequence or array.
157148

158149
### Removed
159150

@@ -173,14 +164,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
173164
* `FlatList.removeRange`: use `removeManyAt`.
174165
* The `ISet<'T>` abbreviation of `IImmutableSet<'T>`, because it shadowed `System.Collections.Generic.ISet<'T>`: use
175166
`IImmutableSet<'T>` and the `ISet` module.
176-
* The `SortedSetBuilder<'T>` abbreviation: use `SortedSet<'T>.Builder`.
177-
* `SortedSet.where`: use `filter`. `SortedSet.pick`, `tryPick` and `vTryPick`, which the FSharp.Core `Set` module does not
178-
have: use `SortedSet.toSeq set |> Seq.pick chooser`, or `Seq.tryPick` and `ValueOption.ofOption`. The public
179-
`SortedSet.check`.
180-
* `SortedSet.ofComparer comparer`, `ofSeqWithComparer comparer elements` and `builderWithComparer comparer`: use
181-
`(SortedSet.forComparer comparer).empty`, `(SortedSet.forComparer comparer).ofSeq elements` and
182-
`(SortedSet.forComparer comparer).builder ()`. `SortedSet.builderWith`, whose argument bound to the comparer overload of
183-
the BCL member, has no replacement: sorted sets have no capacity.
184167

185168
## [1.0.0] - 2020-02-23
186169

0 commit comments

Comments
 (0)