diff --git a/lib/lists.nix b/lib/lists.nix index d6e8628f03a..561a657264b 100644 --- a/lib/lists.nix +++ b/lib/lists.nix @@ -225,4 +225,10 @@ in rec { deepSeqList = xs: y: if any (x: deepSeq x false) xs then y else y; + crossLists = f: xss: + let + argss = fold (l: argss: + concatMap (arg: map (args: [ arg ] ++ args) argss) l + ) [[]] xss; + in map (args: foldl (f: arg: f arg) f args) argss; }