Merge a map/filter Fun.id with filter_map

This commit is contained in:
2024-12-19 14:48:58 +00:00
parent aaa031e6c6
commit 2c8d0845b4

View File

@@ -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