aboutsummaryrefslogtreecommitdiff
path: root/lib/option.ml
diff options
context:
space:
mode:
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 c3fe9ce469..ef7a2e9e58 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