diff options
author | Michael Raskin <7c6f434c@mail.ru> | 2008-01-11 16:58:55 +0000 |
---|---|---|
committer | Michael Raskin <7c6f434c@mail.ru> | 2008-01-11 16:58:55 +0000 |
commit | 5116a523a9cedf5e2848ca4602d8f79866085e80 (patch) | |
tree | bcd56b72fa8e8f7bfa18fe3a87b6be1671fe0fbc /pkgs/lib | |
parent | 437f21219f6e6eb33d6647ec7d05022fa835710b (diff) | |
download | nixlib-5116a523a9cedf5e2848ca4602d8f79866085e80.tar nixlib-5116a523a9cedf5e2848ca4602d8f79866085e80.tar.gz nixlib-5116a523a9cedf5e2848ca4602d8f79866085e80.tar.bz2 nixlib-5116a523a9cedf5e2848ca4602d8f79866085e80.tar.lz nixlib-5116a523a9cedf5e2848ca4602d8f79866085e80.tar.xz nixlib-5116a523a9cedf5e2848ca4602d8f79866085e80.tar.zst nixlib-5116a523a9cedf5e2848ca4602d8f79866085e80.zip |
A few library functions added.
svn path=/nixpkgs/trunk/; revision=10118
Diffstat (limited to 'pkgs/lib')
-rw-r--r-- | pkgs/lib/default.nix | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pkgs/lib/default.nix b/pkgs/lib/default.nix index ca90f9577617..2d300891bcff 100644 --- a/pkgs/lib/default.nix +++ b/pkgs/lib/default.nix @@ -222,6 +222,19 @@ rec { in uniqList {outputList=newOutputList; inputList = (tail inputList);}; + uniqListExt = {inputList, outputList ? [], + getter ? (x : x), compare ? (x: y: x==y)}: + if (inputList == []) then outputList else + let x=head inputList; + isX = y: (compare (getter y) (getter x)); + newOutputList = outputList ++ + (if any isX outputList then [] else [x]); + in uniqListExt {outputList=newOutputList; + inputList = (tail inputList); + inherit getter compare; + }; + + condConcat = name: list: checker: if list == [] then name else |