summaryrefslogtreecommitdiff
path: root/src/util.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.ml')
-rw-r--r--src/util.ml9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util.ml b/src/util.ml
index e0366fe7..c0b88815 100644
--- a/src/util.ml
+++ b/src/util.ml
@@ -232,6 +232,15 @@ let rec option_these = function
| None :: xs -> option_these xs
| [] -> []
+let rec option_all = function
+ | [] -> Some []
+ | None :: _ -> None
+ | Some x :: xs ->
+ begin match option_all xs with
+ | None -> None
+ | Some xs -> Some (x :: xs)
+ end
+
let changed2 f g x h y =
match (g x, h y) with
| (None,None) -> None