You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 377bf02
Browse filesBrowse the repository at this point in the historyBrowse files
fixup! feat: FlatList module with the vocabulary of the FSharp.Core Array module
A default flat list given as a sequence is rejected with `ArgumentNullException`, as it is
when it is given as a flat list (D6). It converts to a sequence without a check and fails
with `InvalidOperationException` when a function enumerates it, so every function that takes
a sequence calls the new `checkNotDefaultSeq` of `Helper.fs` next to its `null` check:
- `concat` and `transpose` for the outer sequence;
- `except` for the items to exclude, also when the input is empty, and before the input is
checked, as FSharp.Core checks them;
- `insertManyAt` for the values, after the check of the index, because FSharp.Core
enumerates the values only then;
- `FlatListBuilder.addRange`, and `for` of the `flatList` expression; `yield!` of a sequence
uses the helper instead of its own copy of the check.
The signatures document the exceptions.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
/// <summary>Concatenates a sequence of flat lists.</summary>
649
649
/// <param name="arrays">The flat lists.</param>
650
650
/// <returns>The concatenation.</returns>
651
-
/// <exception cref="T:System.ArgumentNullException">Thrown when <paramref name="arrays"/> is <see langword="null"/>.</exception>
651
+
/// <exception cref="T:System.ArgumentNullException">Thrown when <paramref name="arrays"/> is <see langword="null"/> or a default flat list, or contains a default flat list.</exception>
652
652
/// <remarks>O(the total length).</remarks>
653
653
[<CompiledName "Concat">]
654
654
val concat : arrays : seq<FlatList<'T>> -> FlatList<'T>
@@ -683,6 +683,7 @@ val insertAt : index : int -> value : 'T -> source : FlatList<'T> -> FlatList<'T
683
683
/// <param name="values">The values to insert.</param>
/// <returns>The flat list with the values.</returns>
686
+
/// <exception cref="T:System.ArgumentNullException">Thrown when <paramref name="values"/> is <see langword="null"/> or a default flat list.</exception>
686
687
/// <exception cref="T:System.ArgumentException">Thrown when the index is negative or greater than the length.</exception>
/// <returns>A flat list whose element i holds the element i of every input flat list.</returns>
811
+
/// <exception cref="T:System.ArgumentNullException">Thrown when <paramref name="arrays"/> is <see langword="null"/> or a default flat list, or contains a default flat list.</exception>
810
812
/// <exception cref="T:System.ArgumentException">Thrown when the flat lists have different lengths.</exception>
/// <returns>The distinct remaining elements, in their order.</returns>
1217
-
/// <exception cref="T:System.ArgumentNullException">Thrown when <paramref name="itemsToExclude"/> is <see langword="null"/>.</exception>
1219
+
/// <exception cref="T:System.ArgumentNullException">Thrown when <paramref name="itemsToExclude"/> is <see langword="null"/> or a default flat list.</exception>
Copy file name to clipboardExpand all lines: src/FSharp.Collections.Immutable/FlatList/FlatListBuilder.fsi
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -80,6 +80,7 @@ val add : value : 'T -> builder : FlatList<'T>.Builder -> FlatList<'T>.Builder
80
80
/// <param name="values">The values to add.</param>
81
81
/// <param name="builder">The builder.</param>
82
82
/// <returns>The same builder.</returns>
83
+
/// <exception cref="T:System.ArgumentNullException">Thrown when <paramref name="values"/> is <see langword="null"/> or a default flat list.</exception>
0 commit comments