Section FinContainer.
Variable spec : FinContainerSpec.
Definition finContainer (a:Type) := {x : shape spec & Vector (card x) a}.
Definition finContainer_traverse a b (F : Applicative) (f : a -> F b) (x : finContainer a) : F (finContainer b) :=
let (s, v) := x in map (existT _ s) (traverse f v).

Lemma finContainer_traverse_compose a b c (F G : Applicative) (f : a -> F b) (g : b -> G c) (x : finContainer a) :
finContainer_traverse (F:=ComposeApplicative F G) (fun y => map g (f y)) x =
map (finContainer_traverse g) (finContainer_traverse f x).