Ltac destruct_match H :=
match type of H with
| context [ match ?x with _ => _  end] => destruct x eqn:?
end.

Lemma exprD_ex_typs : forall tus tvs t (e1 e2 : expr typ func) v, exprD' tus tvs t (App e1 e2) = Some v -> exists t2, typeof_expr tus tvs e1 = Some (tyArr t2 t) /\ typeof_expr tus tvs e2 = Some (t2).