Skip to content

refactor: remove Subarray.foldl and other slice operation aliases#12441

Open
datokrat wants to merge 2 commits intonightly-with-manualfrom
paul/humanevup7
Open

refactor: remove Subarray.foldl and other slice operation aliases#12441
datokrat wants to merge 2 commits intonightly-with-manualfrom
paul/humanevup7

Conversation

@datokrat
Copy link
Contributor

This PR removes Subarray.foldl(M), Subarray.toArray and Subarray.size in favor of the Std.Slice-namespaced operations. Dot notation will continue to work. If, say, Subarray.size is explicitly referred to, an error suggesting to use Std.Slice.size will show up.

@datokrat datokrat changed the title remove Subarray.foldl and other slice operation aliases refactor: remove Subarray.foldl and other slice operation aliases Feb 11, 2026
@datokrat datokrat added the changelog-library Library label Feb 11, 2026
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Feb 11, 2026
@mathlib-lean-pr-testing
Copy link

Mathlib CI status (docs):

  • ❗ Mathlib CI can not be attempted yet, as the nightly-testing-2026-02-07 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Mathlib CI should run now. You can force Mathlib CI using the force-mathlib-ci label. (2026-02-11 16:54:04)

leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Feb 11, 2026
@leanprover-bot
Copy link
Collaborator

leanprover-bot commented Feb 11, 2026

Reference manual CI status:

@leanprover-bot leanprover-bot added the breaks-manual This is not necessarily a blocker for merging, but there needs to be a plan. label Feb 11, 2026
@leanprover-bot leanprover-bot added builds-manual CI has verified that the Lean Language Reference builds against this PR and removed breaks-manual This is not necessarily a blocker for merging, but there needs to be a plan. labels Feb 11, 2026
@datokrat
Copy link
Contributor Author

@david-christiansen Given that we can now use suggest_for for a smoother migration experience, I decided to give the removal of Subarray.foldl in favor of Std.Slice.foldl another chance. The presence of both is confusing during verification. Do you agree that suggest_for makes this change viable?

At least my experience of resolving breakage inside Lean was quite nice; I was able to resolve the problems by clicking on the hints in the error messages.

@datokrat datokrat marked this pull request as ready for review February 11, 2026 19:05
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-manual CI has verified that the Lean Language Reference builds against this PR changelog-library Library toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants