lean4-htt/tests/lean/run/tryPureCoe.lean
Leonardo de Moura 0595e8a78a feat: add tryPureCoe
@Kha It seems to work reasonably well. It didn't break any test.
2020-03-27 11:20:43 -07:00

28 lines
506 B
Text

new_frontend
def m1 : IO Bool :=
pure true
def p (x : Nat) : Bool :=
x > 0
def tst1 : IO Bool :=
true <&&> m1
def tst2 (x : Nat) : IO Bool :=
x = 0 <&&> m1
def tst3 (x : Nat) : IO Unit :=
whenM (m1 <&&> x > 0) $
throw $ IO.userError "test"
def tst4 (x : Nat) : IO Unit :=
whenM (x > 0 <&&> m1) $
throw $ IO.userError "test"
def tst5 (x : Nat) : IO Unit :=
whenM (p x <&&> m1) $
throw $ IO.userError "test"
def tst6 (x : Nat) : IO Unit :=
whenM (p x <&&> id m1) $
throw $ IO.userError "test"