lib/attrsets: rename cartesianProductOfSets to cartesianProduct
This commit is contained in:
parent
7e358fc824
commit
228621e42d
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (builtins) head length;
|
inherit (builtins) head length;
|
||||||
inherit (lib.trivial) mergeAttrs warn;
|
inherit (lib.trivial) isInOldestRelease mergeAttrs warn warnIf;
|
||||||
inherit (lib.strings) concatStringsSep concatMapStringsSep escapeNixIdentifier sanitizeDerivationName;
|
inherit (lib.strings) concatStringsSep concatMapStringsSep escapeNixIdentifier sanitizeDerivationName;
|
||||||
inherit (lib.lists) foldr foldl' concatMap elemAt all partition groupBy take foldl;
|
inherit (lib.lists) foldr foldl' concatMap elemAt all partition groupBy take foldl;
|
||||||
in
|
in
|
||||||
|
@ -885,15 +885,15 @@ rec {
|
||||||
# Type
|
# Type
|
||||||
|
|
||||||
```
|
```
|
||||||
cartesianProductOfSets :: AttrSet -> [AttrSet]
|
cartesianProduct :: AttrSet -> [AttrSet]
|
||||||
```
|
```
|
||||||
|
|
||||||
# Examples
|
# Examples
|
||||||
:::{.example}
|
:::{.example}
|
||||||
## `lib.attrsets.cartesianProductOfSets` usage example
|
## `lib.attrsets.cartesianProduct` usage example
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
cartesianProductOfSets { a = [ 1 2 ]; b = [ 10 20 ]; }
|
cartesianProduct { a = [ 1 2 ]; b = [ 10 20 ]; }
|
||||||
=> [
|
=> [
|
||||||
{ a = 1; b = 10; }
|
{ a = 1; b = 10; }
|
||||||
{ a = 1; b = 20; }
|
{ a = 1; b = 20; }
|
||||||
|
@ -904,7 +904,7 @@ rec {
|
||||||
|
|
||||||
:::
|
:::
|
||||||
*/
|
*/
|
||||||
cartesianProductOfSets =
|
cartesianProduct =
|
||||||
attrsOfLists:
|
attrsOfLists:
|
||||||
foldl' (listOfAttrs: attrName:
|
foldl' (listOfAttrs: attrName:
|
||||||
concatMap (attrs:
|
concatMap (attrs:
|
||||||
|
@ -1999,4 +1999,8 @@ rec {
|
||||||
# DEPRECATED
|
# DEPRECATED
|
||||||
zip = warn
|
zip = warn
|
||||||
"lib.zip is a deprecated alias of lib.zipAttrsWith." zipAttrsWith;
|
"lib.zip is a deprecated alias of lib.zipAttrsWith." zipAttrsWith;
|
||||||
|
|
||||||
|
# DEPRECATED
|
||||||
|
cartesianProductOfSets = warnIf (isInOldestRelease 2405)
|
||||||
|
"lib.cartesianProductOfSets is a deprecated alias of lib.cartesianProduct." cartesianProduct;
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ let
|
||||||
zipAttrsWithNames zipAttrsWith zipAttrs recursiveUpdateUntil
|
zipAttrsWithNames zipAttrsWith zipAttrs recursiveUpdateUntil
|
||||||
recursiveUpdate matchAttrs mergeAttrsList overrideExisting showAttrPath getOutput
|
recursiveUpdate matchAttrs mergeAttrsList overrideExisting showAttrPath getOutput
|
||||||
getBin getLib getDev getMan chooseDevOutputs zipWithNames zip
|
getBin getLib getDev getMan chooseDevOutputs zipWithNames zip
|
||||||
recurseIntoAttrs dontRecurseIntoAttrs cartesianProductOfSets
|
recurseIntoAttrs dontRecurseIntoAttrs cartesianProduct cartesianProductOfSets
|
||||||
updateManyAttrsByPath;
|
updateManyAttrsByPath;
|
||||||
inherit (self.lists) singleton forEach foldr fold foldl foldl' imap0 imap1
|
inherit (self.lists) singleton forEach foldr fold foldl foldl' imap0 imap1
|
||||||
concatMap flatten remove findSingle findFirst any all count
|
concatMap flatten remove findSingle findFirst any all count
|
||||||
|
|
Loading…
Reference in New Issue
Block a user