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 *)

Lemma rev_nth : forall l d n,  n < length l ->
nth n (rev l) d = nth (length l - S n) l d.