Could we replace the use of patternFailure axioms on value declarations:
Definition x := match [1; 2; 3] with (x :: l) => x
| _ => patternFailure
end .
Definition l := match [1; 2; 3] with (x :: l) => l
| _ => patternFailure
end .
by
Definition x := match [1;2;3] as l return l <> [] -> nat with
| x :: _ => fun _ => x
| _ => fun H => match H eq_refl with end end.
Definition l := match [1;2;3] as l1 return l1 <> [] -> list nat with
| _ :: l => fun _ => l
| _ => fun H => match H eq_refl with end end.
Compute x.
Compute l.
??
Notice that x and l have different types in the first and second examples.
Could we replace the use of patternFailure axioms on value declarations:
by
??
Notice that
x
andl
have different types in the first and second examples.