leanprover-community / leanprover-community/mathlib4
Inconsistent parameter ordering in `List.Vector.insertIdx` and `List.insertIdx`
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 4.2k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
For List in Lean:
def insertIdx (xs : List α) (i : Nat) (a : α) : List α
For List.Vector in Mathlib:
def insertIdx (a : α) (i : Fin (n + 1)) (v : Vector α n) : Vector α (n + 1)
The orders of the index parameter i, the value parameter a, and the list/vector parameter xs and v are inconsistent. Should this be fixed?
From https://github.com/leanprover-community/mathlib4/pull/29400#discussion_r2584528551.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare the parameter order in the quoted List.insertIdx and List.Vector.insertIdx definitions, then read the referenced pull-request discussion for the intended direction. Search for usages of both entry points and identify the tests or callers that would need updating; done means the ordering decision is agreed and the affected API and usages are consistent.
Written by the indexing model from the issue text.
Assessment
- Domain
- developer-experience
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100