Add the zipLists and zipListsWith functions.
svn path=/nixpkgs/trunk/; revision=17476
This commit is contained in:
parent
af88789507
commit
e6399964cb
@ -128,4 +128,12 @@ rec {
|
|||||||
) { 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…
x
Reference in New Issue
Block a user