X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Flambda-delta%2Flib%2Fcps.ml;h=38b24903068c42a632c1f10e7002fcb16ebac653;hb=be0ca791abbf1084b7218f2d17ab48462fbb3049;hp=b61fccfa47f148553394d83fb26a5bb369002efc;hpb=4924ddb52a836eea45a593a7f4faccca64bac9e7;p=helm.git diff --git a/helm/software/lambda-delta/lib/cps.ml b/helm/software/lambda-delta/lib/cps.ml index b61fccfa4..38b249030 100644 --- a/helm/software/lambda-delta/lib/cps.ml +++ b/helm/software/lambda-delta/lib/cps.ml @@ -60,6 +60,11 @@ let list_iter f map l = let rec list_fold_left2 f map a l1 l2 = match l1, l2 with | [], [] -> f a | hd1 :: tl1, hd2 :: tl2 -> - let f a = if a = None then f a else list_fold_left2 f map a tl1 tl2 in + let f a = list_fold_left2 f map a tl1 tl2 in map f a hd1 hd2 - | _ -> f None + | _ -> assert false + +let rec list_mem ?(eq=(=)) a = function + | [] -> false + | hd :: _ when eq a hd -> true + | _ :: tl -> list_mem ~eq a tl