aboutsummaryrefslogtreecommitdiff
path: root/theories
diff options
context:
space:
mode:
Diffstat (limited to 'theories')
-rw-r--r--theories/Classes/RelationClasses.v5
-rw-r--r--theories/Lists/List.v10
2 files changed, 10 insertions, 5 deletions
diff --git a/theories/Classes/RelationClasses.v b/theories/Classes/RelationClasses.v
index 1a40e5d599..15cb02d37f 100644
--- a/theories/Classes/RelationClasses.v
+++ b/theories/Classes/RelationClasses.v
@@ -89,6 +89,11 @@ Section Defs.
Global Instance Equivalence_PER {R} `(E:Equivalence R) : PER R | 10 :=
{ }.
+ (** An Equivalence is a PreOrder plus symmetry. *)
+
+ Global Instance Equivalence_PreOrder {R} `(E:Equivalence R) : PreOrder R | 10 :=
+ { }.
+
(** We can now define antisymmetry w.r.t. an equivalence relation on the carrier. *)
Class Antisymmetric eqA `{equ : Equivalence eqA} (R : relation A) :=
diff --git a/theories/Lists/List.v b/theories/Lists/List.v
index c34bbd56e4..2437184a93 100644
--- a/theories/Lists/List.v
+++ b/theories/Lists/List.v
@@ -45,8 +45,8 @@ Section Lists.
Definition hd_error (l:list A) :=
match l with
- | [] => error
- | x :: _ => value x
+ | [] => None
+ | x :: _ => Some x
end.
Definition tl (l:list A) :=
@@ -393,11 +393,11 @@ Section Elts.
simpl; auto.
Qed.
- Fixpoint nth_error (l:list A) (n:nat) {struct n} : Exc A :=
+ Fixpoint nth_error (l:list A) (n:nat) {struct n} : option A :=
match n, l with
- | O, x :: _ => value x
+ | O, x :: _ => Some x
| S n, _ :: l => nth_error l n
- | _, _ => error
+ | _, _ => None
end.
Definition nth_default (default:A) (l:list A) (n:nat) : A :=