Debian Codegraph @

test-suite/success/Cases_bug3758.v

raw
1 (* There used to be an evar leak in the to_nat example *)
2
3 Fixpoint Idx {A:Type} (l:list A) : Type :=
4 match l with
5 | nil => False
6 | cons _ l => True + Idx l
7 end.
8
9 Fixpoint to_nat {A:Type} (l:list A) (i:Idx l) : nat :=
10 match l,i with
11 | nil , i => match i with end
12 | cons _ _, inl _ => 0
13 | cons _ l, inr i => S (to_nat l i)
14 end.