Skip to content

Commit 699b9fd

Browse files
xperiandriclaude
andcommitted
fixup! docs: SortedSet in the changelog and the collection table
- The sentence about the null checks of `SortedSet` also names the default flat list that is given as a sequence, and says that `yield!` and `for` of `sortedSet { }` do the same. - The sentence about the element that stays names the exception of `union` that the remarks of `union` in `SortedSet.fsi` already document: when the second sorted set has another comparer and is much larger, the BCL refills the tree from an unstable sort and either element can stay, so only `addRange` keeps the element of the sorted set in every case (review of #35). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 381c66c commit 699b9fd

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
103103
`NotSupportedException` on a sorted set and have no function.
104104
* `add`, `addRange`, `remove`, `removeRange`, `clear`, `update`, `filter` and `partition` of `SortedSet` keep the comparer
105105
of their input, and the set algebra keeps the comparer of the first sorted set. Every function throws
106-
`ArgumentNullException` for a `null` sorted set, sequence or array. `unionMany` of an empty sequence returns an empty
107-
sorted set, as `Set.unionMany` does. `tryGetValue` returns a `voption`, `choose` takes a function that returns a
108-
`voption`, and `partition` and `partitionWith` return struct tuples.
106+
`ArgumentNullException` for a `null` sorted set, sequence or array, and for a default flat list that is given as a
107+
sequence; `yield!` and `for` of `sortedSet { }` do the same. `unionMany` of an empty sequence returns an empty sorted
108+
set, as `Set.unionMany` does. `tryGetValue` returns a `voption`, `choose` takes a function that returns a `voption`,
109+
and `partition` and `partitionWith` return struct tuples.
109110
* The functions of `SortedSet` that create a sorted set without a comparer, `builder`, `build`, `unionMany` of no sets,
110111
`map`, `choose`, `partitionWith` and `sortedSet { }` order with F# generic comparison, as `Set` does, where the BCL
111112
orders with `Comparer<'T>.Default`. A sorted set thus enumerates its elements in the order of the F# set of the same
@@ -116,12 +117,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
116117
`Seq.exists` and `Seq.forall` with `contains`, and the others take `SortedSet.ofSeq elements`, or
117118
`(SortedSet.forComparer (SortedSet.comparer set)).ofSeq elements` to give the elements the comparer of the first sorted
118119
set.
119-
* The element that stays when the comparer finds two elements equal follows the BCL: `addRange` keeps the element of the
120-
sorted set, `union` keeps the element of the first sorted set, or of the larger one when both have the same comparer,
121-
`intersect` keeps the elements of the second one, and the creation functions keep the first element of their input,
122-
where `CreateRange` and `Create` with a span keep any of them. `isProperSuperset` is the exception: it counts the
123-
elements of the second sorted set that the comparer of the first one finds equal once, as the documentation of
124-
`IsProperSupersetOf` says, where the member counts each of them.
120+
* The element that stays when the comparer finds two elements equal follows the BCL: `union` keeps the element of the
121+
first sorted set, or of the larger one when both have the same comparer, `intersect` keeps the elements of the second
122+
one, and the creation functions keep the first element of their input, where `CreateRange` and `Create` with a span keep
123+
any of them. When the second sorted set of `union` has another comparer and is much larger, the BCL refills the tree
124+
from an unstable sort and either element can stay; only `addRange` keeps the element of the sorted set in every case.
125+
`isProperSuperset` is the exception: it counts the elements of the second sorted set that the comparer of the first one
126+
finds equal once, as the documentation of `IsProperSupersetOf` says, where the member counts each of them.
125127
* `SortedSet.minElement` and `maxElement` take the place of the properties `Min` and `Max`: they read the first and the
126128
last element in O(log n) and throw `ArgumentException` for an empty sorted set, as `Set.minElement` and
127129
`Set.maxElement` do, where the properties return `default`. `tryItem 0` and `tryItem (count - 1)` return a `voption`

0 commit comments

Comments
 (0)