aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPierre Courtieu2014-12-12 15:19:10 +0100
committerPierre Courtieu2014-12-12 15:21:22 +0100
commita417d138c0a8abc028486c20d59e4f2e82f456ef (patch)
tree1f9efdac4020f8dde23583cbccef135f0520caea /lib
parentf47afacd86ff1f9fda5347decf298ace941a24bc (diff)
Searchxxx now search also the hypothesis and support goal selector.
Documentation also updated.
Diffstat (limited to 'lib')
-rw-r--r--lib/util.ml5
-rw-r--r--lib/util.mli4
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/util.ml b/lib/util.ml
index 531e4fe7d6..cfb4ebabc2 100644
--- a/lib/util.ml
+++ b/lib/util.ml
@@ -105,6 +105,11 @@ let app_opt f x =
| Some f -> f x
| None -> x
+let un_opt x default =
+ match x with
+ | None -> default
+ | Some y -> y
+
(* Stream *)
let stream_nth n st =
diff --git a/lib/util.mli b/lib/util.mli
index 86720fe471..bcb1b62651 100644
--- a/lib/util.mli
+++ b/lib/util.mli
@@ -89,6 +89,10 @@ val iterate : ('a -> 'a) -> int -> 'a -> 'a
val repeat : int -> ('a -> unit) -> 'a -> unit
val app_opt : ('a -> 'a) option -> 'a -> 'a
+(** [un_opt opt default] returns the content of [opt] if possible and
+ default otherwise. *)
+val un_opt : 'a option -> 'a -> 'a
+
(** {6 Delayed computations. } *)
type 'a delayed = unit -> 'a