From d4f603fa04283efe54c79b5f7664c4c9bc193857 Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Mon, 12 Oct 2026 11:53:45 -0300 Subject: concat map --- lib/kernel/Path.ml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lib/kernel/Path.ml') diff --git a/lib/kernel/Path.ml b/lib/kernel/Path.ml index a6879b6..4859584 100644 --- a/lib/kernel/Path.ml +++ b/lib/kernel/Path.ml @@ -106,7 +106,7 @@ let assoc_all handle changes = | Some (_, key, _) -> Error (Error.overlapping_change (prefix @ [key])) | None -> let* children = - List.map + Utilities.List.concat_map (fun (x, beneath) -> let* dir = Handle.require Directory.from node in let* found = Directory.find dir x in @@ -117,8 +117,6 @@ let assoc_all handle changes = Handle.releasing child (fun () -> apply (prefix @ [x]) child beneath) |> Result.map (fun child' -> [x, Some child']) ) below - |> Utilities.List.sequence - |> Result.map List.concat in (* each step derives from the last; only the steps in between are ours to release *) @@ -156,7 +154,7 @@ let diff a b = let* left = names a in let* right = names b in List.sort_uniq String.compare (left @ right) - |> List.map (fun name -> + |> Utilities.List.concat_map (fun name -> let path = prefix @ [name] in let* x = find a name in let* y = find b name in @@ -170,7 +168,5 @@ let diff a b = let* below = walk path x y in Ok (if below = [] then [path] else below) | _ -> Ok [path] ) ) - |> Utilities.List.sequence - |> Result.map List.concat in walk [] a b -- cgit v1.2.3