lean4-htt/src/Init/Data/Array
Sebastian Graf 4278038940
feat: new, extensible do elaborator (#12459)
This PR adds a new, extensible `do` elaborator. Users can opt into the
new elaborator by unsetting the option `backward.do.legacy`.

New elaborators for the builtin `doElem` syntax category can be
registered with attribute `doElem_elab`. For new syntax, additionally a
control info handler must be registered with attribute
`doElem_control_info` that specifies whether the new syntax `return`s
early, `break`s, `continue`s and which `mut` vars it reassigns.

Do elaborators have type ``TSyntax `doElem → DoElemCont → DoElabM
Expr``, where `DoElabM` is essentially `TermElabM` and the `DoElemCont`
represents how the rest of the `do` block is to be elaborated. Consult
the docstrings for more details.

Breaking Changes:
* The syntax for `let pat := rhs | otherwise` and similar now scope over
the `doSeq` that follows. Furthermore, `otherwise` and the sequence that
follows are now `doSeqIndented` in order not to steal syntax from record
syntax.
 
Breaking Changes when opting into the new `do` elaborator by unsetting
`backward.do.legacy`:
* `do` notation now always requires `Pure`.
* `do match` is now always non-dependent. There is `do match (dependent
:= true)` that expands to a
  term match as a workaround for some dependent uses.
2026-02-21 17:17:29 +00:00
..
Lex chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
QSort chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Subarray chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Attach.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Basic.lean feat: new, extensible do elaborator (#12459) 2026-02-21 17:17:29 +00:00
BasicAux.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
BinSearch.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Bootstrap.lean feat: backward.isDefEq.respectTransparency (#12179) 2026-02-16 15:57:21 +00:00
Count.lean feat: backward.isDefEq.respectTransparency (#12179) 2026-02-16 15:57:21 +00:00
DecidableEq.lean feat: backward.isDefEq.respectTransparency (#12179) 2026-02-16 15:57:21 +00:00
Erase.lean feat: prove xs.extract start stop = (xs.take stop).drop start for lists (#12359) 2026-02-16 22:43:44 +00:00
Extract.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Find.lean feat: enable implicit argument transparency bump (part 2) (#12572) 2026-02-20 03:28:48 +00:00
FinRange.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
GetLit.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
InsertIdx.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
InsertionSort.lean feat: make private the default in module (#9044) 2025-06-28 16:30:53 +00:00
Int.lean feat: add array lemmas about sum/min/max (#12249) 2026-02-11 13:08:18 +00:00
Lemmas.lean feat: enable implicit argument transparency bump (part 2) (#12572) 2026-02-20 03:28:48 +00:00
Lex.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
MapIdx.lean feat: enable implicit argument transparency bump (part 2) (#12572) 2026-02-20 03:28:48 +00:00
Mem.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
MinMax.lean feat: prove xs.extract start stop = (xs.take stop).drop start for lists (#12359) 2026-02-16 22:43:44 +00:00
Monadic.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Nat.lean feat: add array lemmas about sum/min/max (#12249) 2026-02-11 13:08:18 +00:00
OfFn.lean feat: enable implicit argument transparency bump (part 2) (#12572) 2026-02-20 03:28:48 +00:00
Perm.lean feat: prove xs.extract start stop = (xs.take stop).drop start for lists (#12359) 2026-02-16 22:43:44 +00:00
QSort.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
Range.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Set.lean feat: make private the default in module (#9044) 2025-06-28 16:30:53 +00:00
Subarray.lean refactor: remove Subarray.foldl and other slice operation aliases (#12441) 2026-02-20 08:18:33 +00:00
TakeDrop.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Zip.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00