aboutsummaryrefslogtreecommitdiff
path: root/lib/option.mli
diff options
context:
space:
mode:
authoraspiwack2007-12-07 17:02:48 +0000
committeraspiwack2007-12-07 17:02:48 +0000
commitd619f795a7ffcd46ae6d3eea022f9520cc72ad3d (patch)
tree0cba5e9a76730a4abc6284a084524d3fb608e1b5 /lib/option.mli
parent8b327a118a02e8c29f1c49774c6b2d78e2179b79 (diff)
Util.option_compare devient Option.Misc.Compare et change un peu de type
( ('a -> 'b -> bool) -> 'a option -> 'b option -> bool devient la même chose mais avec 'a='b ) et de contenu pour avoir une sémantique plus claire. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10353 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/option.mli')
-rw-r--r--lib/option.mli12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/option.mli b/lib/option.mli
index 8e768d8af2..4047ebe1a2 100644
--- a/lib/option.mli
+++ b/lib/option.mli
@@ -98,3 +98,15 @@ module List : sig
[Some y] (in the same order). *)
val flatten : 'a option list -> 'a list
end
+
+
+(** {6 Miscelaneous Primitives} *)
+
+module Misc : sig
+ (** [Misc.compare f x y] lifts the equality predicate [f] to
+ option types. That is, if both [x] and [y] are [None] then
+ it returns [true], if they are bothe [Some _] then
+ [f] is called. Otherwise it returns [false]. *)
+ val compare : ('a -> 'a -> bool) -> 'a option -> 'a option -> bool
+end
+