aboutsummaryrefslogtreecommitdiff
path: root/lib/util.ml
diff options
context:
space:
mode:
authorherbelin2002-11-20 20:33:24 +0000
committerherbelin2002-11-20 20:33:24 +0000
commit8d478b8bacbb08d9edb6d8d1fbdea241f013b1cb (patch)
tree6857f5f53611d3c4543a38c8e3fba5debecc9339 /lib/util.ml
parent116ca3333cc918e6e064703e66e28b739168e235 (diff)
Ajout option_fold_left2
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@3258 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/util.ml')
-rw-r--r--lib/util.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/util.ml b/lib/util.ml
index a8dd17e8f2..885278da7a 100644
--- a/lib/util.ml
+++ b/lib/util.ml
@@ -559,6 +559,10 @@ let option_app f = function
| None -> None
| Some x -> Some (f x)
+let option_fold_left2 f e a b = match (a,b) with
+ | Some x, Some y -> f e x y
+ | _ -> e
+
let option_compare f a b = match (a,b) with
| None, None -> true
| Some a', Some b' -> f a' b'