Definition optSwap (A : Set)(opt : option (A * A)) :=
  match opt with
    | None => None
    | Some (a1, a2) =>
      Some (a2, a1)
  end.

Theorem compFold_ret_eq : forall (A B : Set)(eqdb : EqDec B)(ls : list A)(f : B -> A -> B) init, comp_spec eq (compFold _ (fun b a => ret (f b a)) init ls) (ret (fold_left f ls init)).