···92 concatMap flatten remove findSingle findFirst any all count
93 optional optionals toList range replicate partition zipListsWith zipLists
94 reverseList listDfs toposort sort naturalSort compareLists take
95- drop sublist last init crossLists unique intersectLists
96 subtractLists mutuallyExclusive groupBy groupBy';
97 inherit (self.strings) concatStrings concatMapStrings concatImapStrings
98 intersperse concatStringsSep concatMapStringsSep
···92 concatMap flatten remove findSingle findFirst any all count
93 optional optionals toList range replicate partition zipListsWith zipLists
94 reverseList listDfs toposort sort naturalSort compareLists take
95+ drop sublist last init crossLists unique allUnique intersectLists
96 subtractLists mutuallyExclusive groupBy groupBy';
97 inherit (self.strings) concatStrings concatMapStrings concatImapStrings
98 intersperse concatStringsSep concatMapStringsSep
+13
lib/lists.nix
···821 */
822 unique = foldl' (acc: e: if elem e acc then acc else acc ++ [ e ]) [];
8230000000000000824 /* Intersects list 'e' and another list. O(nm) complexity.
825826 Example:
···821 */
822 unique = foldl' (acc: e: if elem e acc then acc else acc ++ [ e ]) [];
823824+ /* Check if list contains only unique elements. O(n^2) complexity.
825+826+ Type: allUnique :: [a] -> bool
827+828+ Example:
829+ allUnique [ 3 2 3 4 ]
830+ => false
831+ allUnique [ 3 2 4 1 ]
832+ => true
833+ */
834+ allUnique = list: (length (unique list) == length list);
835+836+837 /* Intersects list 'e' and another list. O(nm) complexity.
838839 Example: