Definition extractIT i : IdiomaticTransformation (KSApplicative i i) IdApplicative.
exists (@extract i).
exact (@extract_pure i).
exact (@extract_ap i).
Defined.

Lemma duplicate_ap i j k a b (f : KleeneStore i k (a -> b)) (x : KleeneStore i k a):
duplicate j (KSap f x) =
ap (a:=ComposeApplicative (KSApplicative i j) (KSApplicative j k)) (duplicate j f) (duplicate j x).