X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fextlib%2FhExtlib.ml;h=523913cbfcda4e6e2e501103d068d1462ff9232e;hb=916c558005ed665c62699a7a4c5347870c8a3efb;hp=361587b7d33402f4d3989ffde01d72538a88deb6;hpb=023b925489d007fc1a39087e2770aac4b2740159;p=helm.git diff --git a/helm/software/components/extlib/hExtlib.ml b/helm/software/components/extlib/hExtlib.ml index 361587b7d..523913cbf 100644 --- a/helm/software/components/extlib/hExtlib.ml +++ b/helm/software/components/extlib/hExtlib.ml @@ -239,14 +239,14 @@ let list_concat ?(sep = []) = aux [] let rec list_findopt f l = - let rec aux = function + let rec aux k = function | [] -> None | x::tl -> - (match f x with - | None -> aux tl + (match f x k with + | None -> aux (succ k) tl | Some _ as rc -> rc) in - aux l + aux 0 l let split_nth n l = let rec aux acc n l = @@ -464,7 +464,7 @@ let loc_of_floc floc = Stdpp.first_pos floc, Stdpp.last_pos floc;; let floc_of_loc (loc_begin, loc_end) = Stdpp.make_loc (loc_begin, loc_end) -let dummy_floc = floc_of_loc (-1, -1) +let dummy_floc = floc_of_loc (0, 0) let raise_localized_exception ~offset floc exn = let x, y = loc_of_floc floc in