lean4-htt/tests/lean/doIfLet.lean
Leonardo de Moura 483f32edd8 feat: in pure code, do use assume Id monad at do notation
This feature produced counterintuitive behavior and confused users.
See discussion at #770.

As pointed out by @tydeu, it is not too much work to write `Id.run <|`
before the `do` when we want to use the `do` notation in pure code.

closes #770
2021-12-10 12:55:14 -08:00

15 lines
240 B
Text

#eval show Id Nat from do
let mut x := 2
if let n + 1 := x then
x := n
return x
#eval show Id Nat from do
let mut x := 2
if let 0 := x then
x := 0
else if let n + 1 := x then
x := n
else
x := x + 1
return x