Set Implicit Arguments.
Unset Strict Implicit.
Record KleeneStore i j a := kleeneStore
{ dim : nat
; peek : vector j dim -> a
; pos : vector i dim
}.
Definition KSmap i j a b (f : a -> b) (s : KleeneStore i j a) : KleeneStore i j b :=
kleeneStore (fun v => f (peek v)) (pos s).
Record KleeneCoalg (i o : Type -> Type) := kleeneCoalg
{ coalg :> forall a b, (o a) -> KleeneStore (i a) (i b) (o b) }.

Axiom free_b_dim : forall i o (k : KleeneCoalg i o) a b b' (x : o a), dim (coalg k b x) = dim (coalg k b' x).
Axiom t : Type -> Type.
Axiom traverse : KleeneCoalg (fun x => x) t.