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
15 lines
240 B
Text
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
|