From 228eceeed40b0f86e75a394fe8d65e6e93ca2370 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Tue, 12 Jan 2021 13:41:00 +0100 Subject: Move path, some refactoring --- script.it/outline.ml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'script.it/outline.ml') diff --git a/script.it/outline.ml b/script.it/outline.ml index 0dbecd0..1df7588 100755 --- a/script.it/outline.ml +++ b/script.it/outline.ml @@ -1,3 +1,5 @@ +open StdLabels + let internal_path_id = ref 0 type t = @@ -10,3 +12,10 @@ let get_id () = let id = !internal_path_id in incr internal_path_id; id + +let find + : t list -> int -> t option + = fun ts id -> + List.find_opt + ts + ~f:(fun p -> p.id = id) -- cgit v1.2.3