Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
Find a file
Leonardo de Moura df994fd16f fix: add checkColGe to matchAlt
@Kha this is a fix for the example that @gebner posted on Zulip.
There are other possible workarounds, but I think this one is
"intuitive".

Here is the problem description and workaround.
We currently use the `withPosition` combinator at `matchAlts`. The
original motivation was nested `match`-expressions without
parenthesis.
We also have the `checkColGt` in the application parser.

Thus, `frob 5` is not parsed as an application. That is, the term
parser after the `then` keyword stops at `frob`.
Then, we get the weird "expected 'else'" error message at `5` :)

In this commit, I add a `checkColGe` check at the beginning of each
alternative right-hand-side.

The effect on the stdlib was minimal. It basically affected old code
that used the Lean 3 workaround for partial functions
```
partial def f : N -> N | i =>
  ...
```
In Lean 4, we can use the more natural
```
partial def f (i : N) : N :=
...
```
or
```
partial def f : N -> N := fun i =>
...
```

It also affected code such as
```
instance : Repr String.Iterator where
  reprPrec | ⟨s, pos⟩, prec =>
    Repr.addAppParen ("String.Iterator.mk " ++ reprArg s ++ " " ++ reprArg pos) prec
```
This is a workaround for a missing feature. We really wanted to write
```
instance : Repr String.Iterator where
  reprPrec ⟨s, pos⟩ prec :=
    Repr.addAppParen ("String.Iterator.mk " ++ reprArg s ++ " " ++ reprArg pos) prec
```
2021-03-12 11:06:07 -08:00
.github chore: CI: fix 2021-02-12 22:55:22 +01:00
doc chore: fix doc 2021-03-11 11:40:39 -08:00
images
lean4-mode doc: lean4-mode: update keybindings 2021-03-11 21:20:36 +01:00
nix feat: lean4-mode: nicer info view using magit sections 2021-03-10 17:09:41 +01:00
script chore: link lean using leanc 2021-03-06 10:17:50 +01:00
src fix: add checkColGe to matchAlt 2021-03-12 11:06:07 -08:00
stage0 chore: update stage0 2021-03-11 11:26:35 -08:00
tests fix: add checkColGe to matchAlt 2021-03-12 11:06:07 -08:00
tmp chore: remove tactic framework dependency 2020-11-10 14:32:58 -08:00
.gitattributes chore: restore marking stage0/ as binary files, which we lost at some point 2020-08-14 11:12:13 +02:00
.gitignore chore: ignore result files from nix build 2020-11-24 19:16:27 +01:00
CMakeLists.txt chore: use standard release build for stage 0 2020-10-12 10:34:48 +02:00
CONTRIBUTING.md doc: contribution guidelines & README update 2021-01-12 14:38:36 -08:00
default.nix doc: setup 2021-01-03 13:21:58 +01:00
flake.lock chore: Nix: update Nix client to resolve https://github.com/NixOS/nix/issues/4469 2021-01-26 18:01:39 +01:00
flake.nix chore: Nix: stage0debug 2021-01-20 16:48:50 +01:00
LICENSE
README.md doc: contribution guidelines & README update 2021-01-12 14:38:36 -08:00
shell.nix doc: update dev setup editor instructions 2021-02-02 17:30:51 +01:00

This is the repository for Lean 4, which is currently being released as milestone releases towards a first stable release. Lean 3 is still the latest stable release.

About

Installation

See Setting Up Lean.

Contributing

Please read our Contribution Guidelines first.

Building from Source

See Building Lean.