lean4-htt/tests/lean/structuralEqns.lean
2022-08-25 19:07:42 -07:00

25 lines
528 B
Text

import Lean
open Lean
open Lean.Meta
def tst (declName : Name) : MetaM Unit := do
IO.println (← getUnfoldEqnFor? declName)
def foo (xs ys zs : List Nat) : List Nat :=
match (xs, ys) with
| (xs', ys') =>
match zs with
| z::zs => foo xs ys zs
| _ => match ys' with
| [] => [1]
| _ => [2]
#eval tst ``foo
#check foo._unfold
def bar (xs ys : List Nat) : List Nat :=
match xs ++ [], ys ++ [] with
| xs', ys' => xs' ++ ys'
#print bar -- should not contain either `let _discr` aux binding