mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
Add two 'remove' functions
svn path=/nixpkgs/branches/stdenv-updates/; revision=26311
This commit is contained in:
parent
f227549863
commit
3e71355377
@ -50,6 +50,11 @@ rec {
|
||||
filter = pred: list:
|
||||
fold (x: y: if pred x then [x] ++ y else y) [] list;
|
||||
|
||||
# Remove elements 'e' from a list. Useful for buildInputs
|
||||
remove = e: filter (x: x != e);
|
||||
|
||||
# Given two lists, removes all elements of the first list from the second list
|
||||
removeList = l: filter (x: elem x l);
|
||||
|
||||
# Return true if `list' has an element `x':
|
||||
elem = x: list: fold (a: bs: x == a || bs) false list;
|
||||
|
Loading…
Reference in New Issue
Block a user