(* Taken from coq-bigO / Armaël Guéneau *)
Local Set Universe Polymorphism.
Fixpoint Rarrow (domain : list Type) (range : Type) : Type :=
match domain with
| nil => range
| d :: ds => Rarrow ds (d -> range)
end.
Fixpoint Rtuple (domain : list Type) : Type :=
match domain with
| nil => unit
| d :: nil => d
| d :: ds => prod (Rtuple ds) d
end.
Fixpoint Const {A : Type} (domain : list Type) (c : A) : Rarrow domain A :=
match domain with
| nil => c
| d :: ds => Const ds (fun _ => c)
end.
Tactic Notation "_rewrite_anywhere" uconstr(L):=
match goal with
| H : _ |- _ => setoid_rewrite L in H
| _ => setoid_rewrite L
end.
Smpl Create generic.
Smpl Add 2 _rewrite_anywhere Fun'_simpl : generic.

Lemma App_Const_simpl :
forall domain range c x,
@App domain range (Const domain c) x = c.