Merge pull request #27045 from vcunat/meta-refactor-2-rebased

stdenv: Refactor meta checks
This commit is contained in:
John Ericson
2017-07-07 12:35:50 -04:00
committed by GitHub
3 changed files with 252 additions and 231 deletions

View File

@@ -477,4 +477,12 @@ rec {
*/
subtractLists = e: filter (x: !(elem x e));
/* Test if two lists have no common element.
It should be slightly more efficient than (intersectLists a b == [])
*/
mutuallyExclusive = a: b:
(builtins.length a) == 0 ||
(!(builtins.elem (builtins.head a) b) &&
mutuallyExclusive (builtins.tail a) b);
}