aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/util.ml
diff options
context:
space:
mode:
authorGravatar puech <puech@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-07-29 14:28:28 +0000
committerGravatar puech <puech@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-07-29 14:28:28 +0000
commitc9624662706ea91a139241ce9953860f754302eb (patch)
tree0c73de4b29ca048d1de1ea25cef529fc1543dd2d /lib/util.ml
parentc7038a54f86d10a1205cad4733496e1b7de235b7 (diff)
Refl_omega: replaced some generic = on constr by eq_constr
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14355 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/util.ml')
-rw-r--r--lib/util.ml9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/util.ml b/lib/util.ml
index 94b1d37c2..e9f87acb5 100644
--- a/lib/util.ml
+++ b/lib/util.ml
@@ -507,6 +507,15 @@ let rec list_smartfilter f l = match l with
else h :: tl'
else tl'
+let list_index_f f x =
+ let rec index_x n = function
+ | y::l -> if f x y then n else index_x (succ n) l
+ | [] -> raise Not_found
+ in
+ index_x 1
+
+let list_index0_f f x l = list_index_f f x l - 1
+
let list_index x =
let rec index_x n = function
| y::l -> if x = y then n else index_x (succ n) l