Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
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. |
||
|---|---|---|
| .claude | ||
| .github | ||
| doc | ||
| images | ||
| releases_drafts | ||
| script | ||
| src | ||
| stage0 | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .gitpod.Dockerfile | ||
| .gitpod.yml | ||
| .ignore | ||
| CMakeLists.txt | ||
| CMakePresets.json | ||
| CODEOWNERS | ||
| CONTRIBUTING.md | ||
| flake.lock | ||
| flake.nix | ||
| lean-toolchain | ||
| lean.code-workspace | ||
| LICENSE | ||
| LICENSES | ||
| README.md | ||
| RELEASES.md | ||
This is the repository for Lean 4.
About
- Quickstart
- Homepage
- Theorem Proving Tutorial
- Functional Programming in Lean
- Documentation Overview
- Language Reference
- Release notes starting at v4.0.0-m3
- Examples
- External Contribution Guidelines
Installation
See Install Lean.
Contributing
Please read our Contribution Guidelines first.
Building from Source
See Building Lean.