Skip to content

Commit f5818ff

Browse files
xperiandriclaude
andcommitted
docs: IndexedList and IIndexedList in the changelog and the collection table
The changelog lists the new functions, the renamed `ImmutableList` module and functions, the breaking changes of the `List` semantics and the removed functions and modules. The collection tables name `IndexedList` with `indexedList { }` and `IIndexedList` instead of `ImmutableList` and `IIndexedSeq`, and the tutorial creates an `IndexedList`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 44b1f73 commit f5818ff

5 files changed

Lines changed: 35 additions & 7 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
* The `FSharp.Collections.Immutable.Option.FlatList` and `FSharp.Collections.Immutable.Tuple.FlatList` modules repeat the
1616
functions that use value options or struct tuples with options and reference tuples.
1717
* The `FlatListBuilder` module works on the builder of a flat list, and `flatList { }` builds a flat list.
18+
* `IndexedList` has every function of the FSharp.Core `List` module that applies to an immutable list, with its semantics,
19+
parameter names and exceptions and with stable sorts, plus `add`, `binarySearch`, `blit`, `cons`, `indexOf`,
20+
`indexOfWith`, `lastIndexOf`, `lastIndexOfWith`, `ofReadOnlySpan`, `ofSpan`, `skipLast`, `sortWithComparer`,
21+
`takeLast`, `tryTail`, `tryUncons`, `uncons` and the struct partial active patterns `Cons` and `Nil`.
22+
* The `IIndexedList` module has the functions of `IndexedList` for `IImmutableList<'T>`, without the creation and builder
23+
functions, `binarySearch` and `blit`, plus `clear`. Its functions keep the implementation of the input list where the
24+
result has the element type of the input, and return an `IndexedList` otherwise.
25+
* The `FSharp.Collections.Immutable.Option` and `FSharp.Collections.Immutable.Tuple` namespaces have `IndexedList` and
26+
`IIndexedList` modules that repeat the functions that use value options or struct tuples with options and reference
27+
tuples.
28+
* The `IndexedListBuilder` module works on the builder of an indexed list, and `indexedList { }` builds an indexed list.
1829

1930
### Changed
2031

@@ -24,6 +35,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2435
`voption`; the functions that return tuples return struct tuples.
2536
* `FlatList`: every function throws what the FSharp.Core `Array` function of the same name throws. `take` and `splitAt`
2637
throw for a count beyond the length, and a default `ImmutableArray` throws `ArgumentNullException`.
38+
* The `ImmutableList` module is renamed to `IndexedList`, and `reverse`, `withItem`, `insert`, `insertRange` and
39+
`removeRange` are renamed to `rev`, `updateAt`, `insertAt`, `insertManyAt` and `removeManyAt`.
40+
* `IndexedList`: the `try*` functions return `voption`; `choose`, `pick`, `tryPick` and `unfold` take functions that
41+
return `voption`, and the generator of `unfold` returns the element before the state, as in `List.unfold`; the
42+
functions that return tuples return struct tuples.
43+
* `IndexedList`: every function throws what the FSharp.Core `List` function of the same name throws, and a `null` indexed
44+
list throws `ArgumentNullException`. `take`, `skip` and `splitAt` throw the exceptions of `List` for a count beyond the
45+
length.
46+
* `IndexedList`: `append` takes two indexed lists; `contains` compares in F# structural equality; `except` removes every
47+
element equal to an excluded item and the duplicates of the other elements, as `List.except` does; the sorting functions
48+
are stable and order in F# generic comparison.
2749

2850
### Removed
2951

@@ -32,6 +54,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3254
* `FlatList.removeAll`, `removeAllWith`, `removeRange`, `sortRange`, `sortRangeWith`, `sortRangeWithComparer` and `sub`,
3355
and the `ImmutableArray` module alias of `FlatList`.
3456
* The `Seq` module of conversions between the collections.
57+
* `ImmutableList.index`, `indexWith`, `indexFrom`, `indexFromWith`, `indexRange`, `indexRangeWith` and their `lastIndex`
58+
counterparts: use `IndexedList.indexOf`, `indexOfWith`, `lastIndexOf` and `lastIndexOfWith`.
59+
* `ImmutableList.clear`, `exceptWith`, `filterFold`, `remove`, `removeWith`, `replace`, `replaceWith`, `reverseRange`,
60+
`skipUntil` and `takeUntil`: use `IndexedList.empty`, `IIndexedList.clear`, `skipWhile`, `takeWhile` or the members of
61+
`ImmutableList<'T>`.
62+
* The `IndexedSeq` module, its `ReadOnlyList` alias and the `IIndexedSeq<'T>` abbreviation of `IReadOnlyList<'T>`.
3563

3664
## [1.0.0] - 2020-02-23
3765

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ Please also join the [F# Open Source Group](http://fsharp.github.com)
1313
| Module | .NET type | Computation expression |
1414
|---|---|---|
1515
| `FlatList` | `ImmutableArray<'T>` | `flatList { }` |
16-
| `ImmutableList` | `ImmutableList<'T>` | – |
16+
| `IndexedList` | `ImmutableList<'T>` | `indexedList { }` |
17+
| `IIndexedList` | `IImmutableList<'T>` | – |
1718
| `Stack` | `ImmutableStack<'T>` | – |
1819
| `Queue` | `ImmutableQueue<'T>` | – |
1920
| `HashMap` | `ImmutableDictionary<'Key, 'Value>` | – |
2021
| `SortedMap` | `ImmutableSortedDictionary<'Key, 'Value>` | – |
2122
| `HashSet` | `ImmutableHashSet<'T>` | – |
2223
| `SortedSet` | `ImmutableSortedSet<'T>` | – |
23-
| `IIndexedSeq` | `IReadOnlyList<'T>` | – |
2424

2525
[Documentation](https://fsprojects.github.io/FSharp.Collections.Immutable/)
2626

‎docsSrc/Explanations/Background.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ While F# has its own built-in immutable collections, System.Collections.Immutabl
2727
| Module | .NET type | Computation expression |
2828
|---|---|---|
2929
| `FlatList` | `ImmutableArray<'T>` | `flatList { }` |
30-
| `ImmutableList` | `ImmutableList<'T>` | – |
30+
| `IndexedList` | `ImmutableList<'T>` | `indexedList { }` |
31+
| `IIndexedList` | `IImmutableList<'T>` | – |
3132
| `Stack` | `ImmutableStack<'T>` | – |
3233
| `Queue` | `ImmutableQueue<'T>` | – |
3334
| `HashMap` | `ImmutableDictionary<'Key, 'Value>` | – |
3435
| `SortedMap` | `ImmutableSortedDictionary<'Key, 'Value>` | – |
3536
| `HashSet` | `ImmutableHashSet<'T>` | – |
3637
| `SortedSet` | `ImmutableSortedSet<'T>` | – |
37-
| `IIndexedSeq` | `IReadOnlyList<'T>` | – |
3838

3939
---
4040

‎docsSrc/Tutorials/Getting_Started.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ open FSharp.Collections.Immutable
2222

2323
``` F#
2424
// Create an immutable list
25-
let list1 = ImmutableList.ofSeq [1; 2; 3]
25+
let list1 = IndexedList.ofSeq [1; 2; 3]
2626
2727
// Create an immutable hash set
2828
let set1 = HashSet.ofSeq ["a"; "b"]

‎docsSrc/index.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ F# bindings for [System.Collections.Immutable](https://learn.microsoft.com/en-us
99
| Module | .NET type | Computation expression |
1010
|---|---|---|
1111
| `FlatList` | `ImmutableArray<'T>` | `flatList { }` |
12-
| `ImmutableList` | `ImmutableList<'T>` | – |
12+
| `IndexedList` | `ImmutableList<'T>` | `indexedList { }` |
13+
| `IIndexedList` | `IImmutableList<'T>` | – |
1314
| `Stack` | `ImmutableStack<'T>` | – |
1415
| `Queue` | `ImmutableQueue<'T>` | – |
1516
| `HashMap` | `ImmutableDictionary<'Key, 'Value>` | – |
1617
| `SortedMap` | `ImmutableSortedDictionary<'Key, 'Value>` | – |
1718
| `HashSet` | `ImmutableHashSet<'T>` | – |
1819
| `SortedSet` | `ImmutableSortedSet<'T>` | – |
19-
| `IIndexedSeq` | `IReadOnlyList<'T>` | – |
2020

2121
---
2222

0 commit comments

Comments
 (0)