lean4-htt/tests/lean/casesOnCases.lean
2022-08-19 17:39:10 -07:00

16 lines
304 B
Text

import Lean
@[inline] def pred? (x : Nat) : Option Nat :=
match x with
| 0 => none
| x+1 => some x
def isZero (x : Nat) :=
match pred? x with
| some _ => false
| none => true
#eval Lean.Compiler.compile #[``isZero]
set_option trace.Compiler.simp true
#eval Lean.Compiler.compile #[``isZero]