aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/util.ml
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2002-11-24 22:22:08 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2002-11-24 22:22:08 +0000
commit38c3baf926ce1248be7aca5288810e8c000bb55c (patch)
treeaf42e63667f44fae65d48d568233cb4357be4653 /lib/util.ml
parentfad76e59fbaa7371252753a9bc55650aacf6c43c (diff)
Ajout option_cons
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@3265 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 885278da7..441cf3744 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_cons a l = match a with
+ | Some x -> x::l
+ | None -> l
+
let option_fold_left2 f e a b = match (a,b) with
| Some x, Some y -> f e x y
| _ -> e