Skip to content

Commit 8a62b0b

Browse files
xperiandriclaude
andcommitted
fixup! docs: Stack and IStack in the changelog and the collection table
The `Changed` and `Removed` entries name only what the published 1.0.0 had or did, checked in the 1.0.0 assembly: its `Stack` module has `cons`, `empty`, `head`, `ofArray`, `ofSeq`, `peek`, `pop`, `push`, `tail` and the complete active pattern `Cons | Nil`. - `Removed` keeps `push`, `peek` and `pop`, with their replacements, and says that `pop` returned a reference tuple. The `ImmutableStack` module alias goes: an abbreviation of a module cannot be used from another assembly. - `Changed` compares with 1.0.0. `ofSeq` and `ofArray` put the first element on top where they put the last one. `cons`, `head` and `tail` take and return `ImmutableStack<'T>` where they took and returned `IImmutableStack<'T>`, and compile to `Push`, `Peek` and `Pop`. `head` and `tail` of an empty stack throw `ArgumentException` where they threw `InvalidOperationException`. A `null` stack threw `ArgumentNullException` in 1.0.0 too, so that is no longer listed, and neither are `uncons`, `ofList`, `toList`, `rev` and the transformations, which 1.0.0 did not have. - `Added` no longer names the patterns `Cons` and `Nil`, which 1.0.0 had as one complete pattern, nor `cons`, `head` and `tail` in the sentence about compiled names. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent e153323 commit 8a62b0b

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5656
value that no element equals, as the builder of an indexed list does.
5757
* `Stack` has every function of the FSharp.Core `List` module that applies to an immutable stack, with its semantics and
5858
exceptions and with stable sorts, plus `consMany`, `ofReadOnlySpan`, `ofSpan`, `skipLast`, `sortWithComparer`,
59-
`takeLast`, `tryTail`, `tryUncons`, `uncons` and the struct partial active patterns `Cons` and `Nil`. Its functions name
60-
their stacks `stack`, `stack1` and `stacks` where `List` names its lists, and the exceptions report these names. `cons`,
61-
`consMany`, `head`, `tail` and `uncons` compile to `Push`, `PushMany`, `Peek`, `Pop` and `PeekPop`, and `tryHead`,
62-
`tryTail` and `tryUncons` to `TryPeek`, `TryPop` and `TryPeekPop`, in the `IStack`, `Option` and `Tuple` modules too.
59+
`takeLast`, `tryTail`, `tryUncons` and `uncons`. A stack enumerates its elements from the top, and every function
60+
treats it as a list in that order; `rev` puts the last element on top. Its functions name their stacks `stack`,
61+
`stack1` and `stacks` where `List` names its lists, and the exceptions report these names. `consMany`, `uncons`,
62+
`tryHead`, `tryTail` and `tryUncons` compile to `PushMany`, `PeekPop`, `TryPeek`, `TryPop` and `TryPeekPop`, in the
63+
`IStack`, `Option` and `Tuple` modules too.
6364
* The `IStack` module has the functions of `Stack` for `IImmutableStack<'T>`, without the creation functions, plus
6465
`clear`. Its functions keep the implementation of the input stack where the result has the element type of the input,
6566
and return a `Stack` otherwise. `append` pushes the first stack onto the second one, which receives the elements, so
@@ -122,16 +123,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
122123
* `IndexedList.rev` builds the reversed list from a reversed copy of the elements. At 100 000 integers it takes about 3 ms
123124
where `reverse`, which called `ImmutableList.Reverse`, took about 23 ms, and it allocates 5.2 MB where `reverse`
124125
allocated 4.8 MB.
125-
* `Stack`: a stack enumerates its elements from the top, and every function treats it as a list in that order. `ofSeq`,
126-
`ofList` and `ofArray` put the first element on top, so that `ofSeq` is the inverse of `toList`, while `ofSeq` and
127-
`ofArray` wrapped `ImmutableStack.CreateRange`, which puts the last element on top. The transformations keep the order,
128-
and `rev` reverses it.
129-
* `Stack`: the functions take and return `ImmutableStack<'T>` instead of `IImmutableStack<'T>`; the functions for the
130-
interface are in the `IStack` module.
131-
* `Stack`: `head`, `tail` and `uncons` of an empty stack throw the `ArgumentException` of `List.head` and `List.tail`
132-
instead of the `InvalidOperationException` of `ImmutableStack`, and a `null` stack throws `ArgumentNullException`.
133-
* `Stack`: the complete active pattern `Cons | Nil` is replaced by the struct partial active patterns `Cons`, which matches
134-
a struct tuple, and `Nil`.
126+
* `Stack`: `ofSeq` and `ofArray` put the first element on top, so that the stack enumerates the elements in the order of
127+
the input. They wrapped `ImmutableStack.CreateRange`, which puts the last element on top.
128+
* `Stack`: `cons`, `head` and `tail` take and return `ImmutableStack<'T>`, where they took and returned
129+
`IImmutableStack<'T>`; the `IStack` module has them for the interface. They compile to `Push`, `Peek` and `Pop`, where
130+
1.0.0 compiled them under their F# names.
131+
* `Stack`: `head` and `tail` of an empty stack throw the `ArgumentException` of `List.head` and `List.tail`, where they
132+
threw the `InvalidOperationException` of `ImmutableStack`.
133+
* `Stack`: the complete active pattern `Cons | Nil`, which matched a reference tuple, is replaced by the struct partial
134+
active patterns `Cons`, which matches a struct tuple, and `Nil`.
135135

136136
### Removed
137137

@@ -169,8 +169,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
169169
* The `IndexedSeq` module and the `IIndexedSeq<'T>` abbreviation of `IReadOnlyList<'T>`: use `IReadOnlyList<'T>`, whose
170170
`Count` and indexer replace `IndexedSeq.length` and `IndexedSeq.item`. `IndexedSeq.check` needs no replacement, because
171171
every function of the list modules throws `ArgumentNullException` for a `null` list.
172-
* `Stack.push`, `peek` and `pop`: use `cons`, `head` and `uncons`.
173-
* The `ImmutableStack` module alias of `Stack`.
172+
* `Stack.push`, `peek` and `pop`: use `cons`, `head` and `uncons`. `pop` returned the top and the stack below it as a
173+
reference tuple; `uncons` returns a struct tuple.
174174

175175
## [1.0.0] - 2020-02-23
176176

0 commit comments

Comments
 (0)