Skip to content

Commit a8c5fb5

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 8cbc78e commit a8c5fb5

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
@@ -111,9 +111,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
111111
`NotSupportedException` on a sorted set and have no function.
112112
* `add`, `addRange`, `remove`, `removeRange`, `clear`, `update`, `filter` and `partition` of `SortedSet` keep the comparer
113113
of their input, and the set algebra keeps the comparer of the first sorted set. Every function throws
114-
`ArgumentNullException` for a `null` sorted set, sequence or array. `unionMany` of an empty sequence returns an empty
115-
sorted set, as `Set.unionMany` does. `tryGetValue` returns a `voption`, `choose` takes a function that returns a
116-
`voption`, and `partition` and `partitionWith` return struct tuples.
114+
`ArgumentNullException` for a `null` sorted set, sequence or array, and for a default flat list that is given as a
115+
sequence; `yield!` and `for` of `sortedSet { }` do the same. `unionMany` of an empty sequence returns an empty sorted
116+
set, as `Set.unionMany` does. `tryGetValue` returns a `voption`, `choose` takes a function that returns a `voption`,
117+
and `partition` and `partitionWith` return struct tuples.
117118
* The functions of `SortedSet` that create a sorted set without a comparer, `builder`, `build`, `unionMany` of no sets,
118119
`map`, `choose`, `partitionWith` and `sortedSet { }` order with F# generic comparison, as `Set` does, where the BCL
119120
orders with `Comparer<'T>.Default`. A sorted set thus enumerates its elements in the order of the F# set of the same
@@ -124,12 +125,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
124125
`Seq.exists` and `Seq.forall` with `contains`, and the others take `SortedSet.ofSeq elements`, or
125126
`(SortedSet.forComparer (SortedSet.comparer set)).ofSeq elements` to give the elements the comparer of the first sorted
126127
set.
127-
* The element that stays when the comparer finds two elements equal follows the BCL: `addRange` keeps the element of the
128-
sorted set, `union` keeps the element of the first sorted set, or of the larger one when both have the same comparer,
129-
`intersect` keeps the elements of the second one, and the creation functions keep the first element of their input,
130-
where `CreateRange` and `Create` with a span keep any of them. `isProperSuperset` is the exception: it counts the
131-
elements of the second sorted set that the comparer of the first one finds equal once, as the documentation of
132-
`IsProperSupersetOf` says, where the member counts each of them.
128+
* The element that stays when the comparer finds two elements equal follows the BCL: `union` keeps the element of the
129+
first sorted set, or of the larger one when both have the same comparer, `intersect` keeps the elements of the second
130+
one, and the creation functions keep the first element of their input, where `CreateRange` and `Create` with a span keep
131+
any of them. When the second sorted set of `union` has another comparer and is much larger, the BCL refills the tree
132+
from an unstable sort and either element can stay; only `addRange` keeps the element of the sorted set in every case.
133+
`isProperSuperset` is the exception: it counts the elements of the second sorted set that the comparer of the first one
134+
finds equal once, as the documentation of `IsProperSupersetOf` says, where the member counts each of them.
133135
* `SortedSet.minElement` and `maxElement` take the place of the properties `Min` and `Max`: they read the first and the
134136
last element in O(log n) and throw `ArgumentException` for an empty sorted set, as `Set.minElement` and
135137
`Set.maxElement` do, where the properties return `default`. `tryItem 0` and `tryItem (count - 1)` return a `voption`

0 commit comments

Comments
 (0)