Section CompLoop.
Variable A : Set.
Hypothesis eqd : EqDec A.
Variable c : A -> Comp A.
Hypothesis c_wf : forall a, well_formed_comp (c a).
Definition compLoop n (a : A) : Comp A :=
compFold _ (fun a n => c a) a (allNatsLt n).
intuition.
eapply compFold_wf; intuition.
Qed.
End CompLoop.

Theorem compLoop_O :
forall (A : Set)(eqda : EqDec A)(c : A -> Comp A) a,
(compLoop _ c O a) = ret a.