Skip to content

Commit

Permalink
Bump to Lean v4.6.0-rc1 and add tests for #31 (#32)
Browse files Browse the repository at this point in the history
* Add test on the Lean 4 PR toolchain

* Update lean-toolchain

* Update lean-toolchain
  • Loading branch information
eric-wieser authored Feb 5, 2024
1 parent 1c88406 commit 190ec9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions examples/matching.lean
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,11 @@ def getNatAdd (e : Expr) : MetaM (Option (Q(Nat) × Q(Nat))) := do

#eval do guard <| (← getNatAdd q(1 + 2)) == some (q(1), q(2))
#eval do guard <| (← getNatAdd q((1 + 2 : Int))) == none

def pairLit (u : Lean.Level) (α : Q(Type u)) (a : Q($α)) : MetaM Q($α × $α) := do
match u, α, a with
| 0, ~q(Nat), n => return q(($n, $n))
| 0, ~q(Int), z => return q(($z, $z))
| _, _, _ => failure

#eval show MetaM Unit from do guard <| (←pairLit _ _ q(2)) == q((2, 2))
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
leanprover/lean4:v4.0.0
leanprover/lean4:v4.6.0-rc1

0 comments on commit 190ec9a

Please sign in to comment.