Skip to content

docs: add ADR 0001 for the per-collection module rewrite - #23

Open
xperiandri wants to merge 2 commits into
mainfrom
docs/adr-collection-modules
Open

xperiandri wants to merge 2 commits into
mainfrom
docs/adr-collection-modules

Conversation

@xperiandri

Copy link
Copy Markdown
Collaborator

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## 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 x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in 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.

  • Build and tests pass locally
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

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...

xperiandri and others added 2 commits October 11, 2026 01:41
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>
Copilot AI balanced review requested due to automatic review settings October 10, 2026 23:44
@xperiandri
xperiandri requested a review from Thorium October 10, 2026 23:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants