From abd3caadefd37d0390f73236b3e3d890bb626147 Mon Sep 17 00:00:00 2001 From: Anders Fugmann Date: Tue, 23 Apr 2024 10:47:46 +0200 Subject: [PATCH] Add list function for compatibility with 4.08 --- src/plugin/utils.ml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugin/utils.ml b/src/plugin/utils.ml index 9219ca2..b0c4f5f 100644 --- a/src/plugin/utils.ml +++ b/src/plugin/utils.ml @@ -70,6 +70,10 @@ module List = struct | _ :: xs -> inner (i+1) xs in inner 0 lst + + let rec find_map ~f = function + | [] -> None + | x :: xs -> match f x with Some _ as v -> v | None -> find_map ~f xs end module StringMap = struct