aboutsummaryrefslogtreecommitdiff
path: root/src/tools.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools.ml')
-rwxr-xr-xsrc/tools.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tools.ml b/src/tools.ml
index 6dfe564..7f500bf 100755
--- a/src/tools.ml
+++ b/src/tools.ml
@@ -18,6 +18,12 @@ module Option = struct
| None -> v
| Some x -> x
+ let test f v = begin
+ match f v with
+ | Some x -> x
+ | None -> v
+ end
+
end
@@ -97,7 +103,7 @@ module List = struct
| [] -> raise Not_found
| hd::tl -> begin match f hd with
| Some x -> x
- | None -> (find_map[@tailrec]) f tl
+ | None -> (find_map[@tailcall]) f tl
end
end