Moved 'zip' function from nixos/lib/build-vms.nix

svn path=/nixpkgs/trunk/; revision=22882
This commit is contained in:
Sander van der Burg 2010-08-02 16:10:01 +00:00
parent cc84ac9e84
commit beee6e5e1d

View file

@ -177,4 +177,10 @@ rec {
let loop = l: if tail l == [] then head l else loop (tail l); in
loop list;
# Zip two lists together.
zip = xs: ys:
if xs != [] && ys != [] then
[ {first = head xs; second = head ys;} ]
++ zip (tail xs) (tail ys)
else [];
}