diff options
Diffstat (limited to 'lib/option.mli')
| -rw-r--r-- | lib/option.mli | 12 |
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 + |
