Section ListOps.
Variable A : Type.
(*************************)
(** ** Reverse           *)
(*************************)
Fixpoint rev (l:list A) : list A :=
match l with
| [] => []
| x :: l' => rev l' ++ [x]
end.
Remark rev_unit : forall (l:list A) (a:A), rev (l ++ [a]) = a :: rev l.
(** Compatibility with other operations *)
(**  An alternative tail-recursive definition for reverse *)
Fixpoint rev_append (l l': list A) : list A :=
match l with
| [] => l'
| a::l => rev_append l (a::l')
end.
Definition rev' l : list A := rev_append l [].

Lemma rev_alt : forall l, rev l = rev_append l [].