diff options
author | 2012-12-13 14:49:35 +0000 | |
---|---|---|
committer | 2012-12-13 14:49:35 +0000 | |
commit | 989d7d5f4d3d023704935f2db49090b9ac4b2e13 (patch) | |
tree | c1f73dd93200d63e3373cf6db354d4aacd11dc68 /lib/option.mli | |
parent | de08c197502d6e7c7c43c3b16f3bea9c9e504662 (diff) |
Renamed Option.Misc.compare to the more uniform Option.equal.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16063 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/option.mli')
-rw-r--r-- | lib/option.mli | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/option.mli b/lib/option.mli index faae301ab..0b50c588b 100644 --- a/lib/option.mli +++ b/lib/option.mli @@ -13,6 +13,8 @@ they actually are similar considering ['a option] as a type of lists with at most one element. *) +exception IsNone + (** [has_some x] is [true] if [x] is of the form [Some y] and [false] otherwise. *) val has_some : 'a option -> bool @@ -20,7 +22,11 @@ val has_some : 'a option -> bool (** Negation of [has_some] *) val is_empty : 'a option -> bool -exception IsNone +(** [equal 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 both [Some _] then + [f] is called. Otherwise it returns [false]. *) +val equal : ('a -> 'a -> bool) -> 'a option -> 'a option -> bool (** [get x] returns [y] where [x] is [Some y]. It raises IsNone if [x] equals [None]. *) @@ -106,15 +112,3 @@ module List : sig val find : ('a -> 'b option) -> 'a list -> 'b option 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 - |