diff --git a/pkgs/lib/lists.nix b/pkgs/lib/lists.nix index 012b95ad061..785e47e7d52 100644 --- a/pkgs/lib/lists.nix +++ b/pkgs/lib/lists.nix @@ -127,5 +127,13 @@ rec { else { right = t.right; wrong = [h] ++ t.wrong; } ) { right = []; wrong = []; }; - + + zipListsWith = f: fst: snd: + if fst != [] && snd != [] then + [ (f (head fst) (head snd)) ] + ++ zipLists (tail fst) (tail snd) + else []; + + zipLists = zipListsWith (fst: snd: { inherit fst snd; }); + }