diff --git a/nib/std/lists.nix b/nib/std/lists.nix index 868bc3e..54ff919 100644 --- a/nib/std/lists.nix +++ b/nib/std/lists.nix @@ -1,4 +1,9 @@ -{...}: rec { +{nib, ...}: let + inherit + (nib.std) + min + ; +in rec { foldl = op: nul: list: let foldl' = n: if n == -1 @@ -52,5 +57,8 @@ then default else builtins.elemAt list index; - zipLists = zipListsWith (fst: snd: {inherit fst snd;}); + zipListsWith = f: fst: snd: + builtins.genList (n: f (builtins.elemAt fst n) (builtins.elemAt snd n)) (min (builtins.length fst) (builtins.length snd)); + + # zipLists = zipListsWith (fst: snd: {inherit fst snd;}); }