lib/lists: add intersect and substract functions

This commit is contained in:
Jaka Hudoklin 2015-02-28 04:02:15 +01:00
parent c4ae25e827
commit ea13e2aa87

View file

@ -233,4 +233,9 @@ rec {
xs = unique (drop 1 list);
in [x] ++ remove x xs;
# Intersects list 'e' and another list
intersect = e: filter (x: elem x e);
# Substracts list 'e' from another list
substract = e: filter (x: !(elem x e));
}