From 2c8d0845b48840a92728868e8f46ff37541eaf2f Mon Sep 17 00:00:00 2001 From: Matthew Gretton-Dann Date: Thu, 19 Dec 2024 14:48:58 +0000 Subject: [PATCH] Merge a map/filter Fun.id with filter_map --- bin/day2407.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/day2407.ml b/bin/day2407.ml index d4ab0cf..3200b8f 100644 --- a/bin/day2407.ml +++ b/bin/day2407.ml @@ -35,8 +35,8 @@ let is_valid_target tgt nums ops = | [] -> List.exists (( = ) 0) tgts | h :: t -> impl - (List.map (fun tgt -> List.map (fun op -> op tgt h) ops) tgts - |> List.concat |> List.filter_map Fun.id) + (List.map (fun tgt -> List.filter_map (fun op -> op tgt h) ops) tgts + |> List.concat) t in impl [ tgt ] nums