Section Research.
Variables (F:Applicative) (a b : Type) (h : a -> F b).
Definition research c (k : KSApplicative a b c) : F c :=
map (peek (k:=k)) (sequenceVector (Vector.map h (pos k))).
Definition Research : IdiomaticTransformation (KSApplicative a b) F.
exists research.
exact research_pure.
exact research_ap.
Defined.
End Research.
Record Traversal := traversal
{ container :> Type -> Type
; traverse : forall a b (F : Applicative), (a -> F b) -> container a -> F (container b)
; free_applicative : forall a b (F G : Applicative) (eta : IdiomaticTransformation F G) (f : a -> F b) (x : container a),
eta _ (traverse f x) = traverse (fun y => eta _ (f y)) x
; traverse_identity : forall a (x : container a),
traverse (F:=IdApplicative) (fun y => y) x = x
; traverse_compose :
forall a b c (F G : Applicative) (f : a -> F b) (g : b -> G c) (x : container a),
traverse (F:=ComposeApplicative F G) (fun y => map g (f y)) x =
map (traverse g) (traverse f x)
}.

Lemma traverseVector_compose n a b c (F G : Applicative) (f : a -> F b) (g : b -> G c) (x : Vector.t a n) :
traverseVector (F:=ComposeApplicative F G) (fun y => map g (f y)) x =
map (traverseVector g) (traverseVector f x).