Section Traversal.
Definition impure a b (x : a) : KleeneStore a b b :=
kleeneStore (fun v => Vector.hd v) (Vector.cons _ x _ (Vector.nil _)).
Variable T : Traversal.
(* Definition liftT a b (f : a -> b) := traverse (t:=T) (F:=IdApplicative) f.  Lemma free_traversal_b a b b' (h : b -> b') (F : Applicative) (f : a -> F b) (x : T a) : map (liftT h) (traverse f x) = traverse (fun y => map h (f y)) x. *)
Let traversal_coalg a b := traverse (t:=T) (F:=KSApplicative a b) (impure (a:=a) b).

Lemma traversal_coalg_duplicate a b c (x: T a) :
duplicateIT a b c _ (traversal_coalg c x) = KSmap (traversal_coalg c) (traversal_coalg b x).