forked from mirrors/nixpkgs
Add the reverseList function.
svn path=/nixpkgs/trunk/; revision=17676
This commit is contained in:
parent
730c14b4b7
commit
e528b920bb
|
@ -136,4 +136,10 @@ rec {
|
|||
|
||||
zipLists = zipListsWith (fst: snd: { inherit fst snd; });
|
||||
|
||||
# invert the order of the elements of a list.
|
||||
reverseList = l:
|
||||
let reverse_ = accu: l:
|
||||
if l == [] then accu
|
||||
else reverse_ ([(head l)] ++ accu) (tail l);
|
||||
in reverse_ [] l;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue