Variables (T R : Type) (f : R -> T -> R).
Fixpoint foldl z s := if s is x :: s' then foldl (f z x) s' else z.

(* Specifications: *)
Lemma foldl_rev z s : foldl z (rev s) = foldr (fun x z => f z x) z s.
Lemma foldl_cat z s1 s2 : foldl z (s1 ++ s2) = foldl (foldl z s1) s2.
End FoldLeft.