Fixpoint compact_prod (T: list Type): Type :=
match T with
| nil => unit
| t :: nil => t
| t :: T0 => (t * compact_prod T0)%type
end.
Fixpoint compact_sum (T: list Type): Type :=
match T with
| nil => unit
| t :: nil => t
| t :: T0 => (t + compact_sum T0)%type
end.
Definition compact_prod_gen {A} {F} (gen: forall a: A, F a) (l: list A): compact_prod (map F l).

Lemma compact_sum_eq: forall {A} {F1: A -> Type} {F2: A -> Type} (l: list A), (forall a, In a l -> @eq Type (F1 a) (F2 a)) -> @eq Type (compact_sum (map F1 l)) (compact_sum (map F2 l)).