Skip to content

Commit fa51801

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 f8d0f98 commit fa51801

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

0 commit comments

Comments
 (0)