mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
Add the zipLists and zipListsWith functions.
svn path=/nixpkgs/trunk/; revision=17476
This commit is contained in:
parent
af88789507
commit
e6399964cb
1 changed files with 9 additions and 1 deletions
|
@ -127,5 +127,13 @@ rec {
|
||||||
else { right = t.right; wrong = [h] ++ t.wrong; }
|
else { right = t.right; wrong = [h] ++ t.wrong; }
|
||||||
) { right = []; 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; });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue