lean4-htt/tests/lean/run/lcnf3.lean
2022-11-13 17:45:21 -08:00

22 lines
393 B
Text

import Lean
set_option compiler.checkTypes true
def f1 (x : Option Nat) (y : Nat) : Nat :=
let z := some y
if let (some x, some y) := (x, z) then
x + y
else
0
inductive Ty where
| c1 | c2 | c3 | c4 | c5
def f2 (a b : Ty) (n : Nat) : Nat :=
let x := match a with
| .c1 => 10 * n
| _ => 20 * n
let y := match b with
| .c2 => 10 + n
| _ => 20 + n
x + y