Repository navigation
docs: add ADR 0001 for the per-collection module rewrite - #23
Open
xperiandri wants to merge 2 commits into
Open
xperiandri wants to merge 2 commits into
xperiandri wants to merge 2 commits into
Conversation
Records the decisions behind the rewrite of the collection modules: one folder and signature file per collection, `FrozenMap`/`FrozenSet` support, `voption` and struct-tuple defaults with `Option`/`Tuple` override namespaces, category-based function order, BCL/LINQ-first implementation, shared contract tests, one pull request per collection, and the function-by-collection support matrices. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…0001 Moves both items from follow-ups into the decision: a nested `FlatList.Parallel` module mirroring `Array.Parallel` through the zero-copy bridge, delivered as its own pull request after `FlatList`, and `alternateLookup`/`tryAlternateLookup` on `FrozenMap`/`FrozenSet` under `#if NET10_0_OR_GREATER`, delivered inside the Frozen pull requests. The appendices gain the matching matrix rows. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Several documented contracts conflict with underlying collection behavior, and the ADR is future-dated.
4 open findings
What changed in this PR
Adds ADR 0001 to define the planned per-collection module rewrite.
Changes:
- Defines API, layout, implementation, and testing decisions.
- Introduces Frozen collection support and value-type defaults.
- Documents per-collection support matrices and delivery plan.
| File | Description |
|---|---|
docsSrc/Explanations/ADR_0001_Collection_Modules.md |
Adds the architectural decision record and API matrices. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+87
to
+89
| * The namespace `FSharp.Collections.Immutable.Option` contains, per collection, a module with the same name holding every | ||
| function whose signature mentions an option, with the **exact FSharp.Core signature** (reference tuples inside option | ||
| payloads: `unfold : ('State -> ('T * 'State) option) -> …`). |
Comment on lines
+139
to
+140
| Consequences for the types: `FlatList` range operations (`sub`, `take`, `skip`, `truncate`, `splitAt`, `takeLast`, `skipLast`, | ||
| `chunkBySize`, `windowed`) return slices over shared storage; `IndexedList` ranges use `GetRange` (O(log n)); `Stack` reverses |
Comment on lines
+259
to
+261
| | `ofReadOnlySpan` | | ᵇ | ᵇ | – | ᵇ | – | ᵇ | – | `Create(ReadOnlySpan)` | | ||
| | `ofSeq` | | ✓ | ✓ | – | ✓ | – | ✓ | – | `CreateRange`; Stack: top = first element | | ||
| | `ofSpan` | | ᵇ | ᵇ | – | ᵇ | – | ᵇ | – | | |
| | `take` / `takeWhile` / `truncate` | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | `take` throws when short | | ||
| | **Sorting** | | | | | | | | | | | ||
| | `sort` / `sortBy` / `sortByDescending` / `sortDescending` | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | unstable | | ||
| | `sortWith` | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | stable | |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Records the decisions behind the rewrite of the collection modules: one
folder and signature file per collection,
FrozenMap/FrozenSetsupport,
voptionand struct-tuple defaults withOption/Tupleoverride namespaces, category-based function order, BCL/LINQ-first
implementation, shared contract tests, one pull request per collection,
and the function-by-collection support matrices.
Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com## Proposed Changes
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.
Types of changes
What types of changes does your code introduce to FSharp.Collections.Immutable?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...