Moved 'zip' function from nixos/lib/build-vms.nix
svn path=/nixpkgs/trunk/; revision=22882
This commit is contained in:
parent
cc84ac9e84
commit
beee6e5e1d
|
@ -177,4 +177,10 @@ rec {
|
||||||
let loop = l: if tail l == [] then head l else loop (tail l); in
|
let loop = l: if tail l == [] then head l else loop (tail l); in
|
||||||
loop list;
|
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 [];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue