aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/option.ml
diff options
context:
space:
mode:
authorGravatar pboutill <pboutill@85f007b7-540e-0410-9357-904b9bb8a0f7>2012-03-02 22:30:29 +0000
committerGravatar pboutill <pboutill@85f007b7-540e-0410-9357-904b9bb8a0f7>2012-03-02 22:30:29 +0000
commit401f17afa2e9cc3f2d734aef0d71a2c363838ebd (patch)
tree7a3e0ce211585d4c09a182aad1358dfae0fb38ef /lib/option.ml
parent15cb1aace0460e614e8af1269d874dfc296687b0 (diff)
Noise for nothing
Util only depends on Ocaml stdlib and Utf8 tables. Generic pretty printing and loc functions are in Pp. Generic errors are in Errors. + Training white-spaces, useless open, prlist copies random erasure. Too many "open Errors" on the contrary. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15020 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/option.ml')
-rw-r--r--lib/option.ml7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/option.ml b/lib/option.ml
index c3fe9ce46..ef7a2e9e5 100644
--- a/lib/option.ml
+++ b/lib/option.ml
@@ -153,6 +153,13 @@ module List =
let rec flatten = function
| x::l -> cons x (flatten l)
| [] -> []
+
+ let rec find f = function
+ |[] -> None
+ |h :: t -> match f h with
+ |None -> find f t
+ |x -> x
+
end