rename flattenAttrsets
-> joinAttrsets
to disambiguate
This commit is contained in:
@@ -13,7 +13,7 @@ sane-lib = rec {
|
|||||||
|
|
||||||
# like `builtins.listToAttrs` but any duplicated `name` throws error on access.
|
# like `builtins.listToAttrs` but any duplicated `name` throws error on access.
|
||||||
# Type: listToDisjointAttrs :: [{ name :: String, value :: Any }] -> AttrSet
|
# Type: listToDisjointAttrs :: [{ name :: String, value :: Any }] -> AttrSet
|
||||||
listToDisjointAttrs = l: flattenAttrsets (builtins.map nameValueToAttrs l);
|
listToDisjointAttrs = l: joinAttrsets (builtins.map nameValueToAttrs l);
|
||||||
|
|
||||||
# true if p is a prefix of l (even if p == l)
|
# true if p is a prefix of l (even if p == l)
|
||||||
# Type: isPrefixOfList :: [Any] -> [Any] -> bool
|
# Type: isPrefixOfList :: [Any] -> [Any] -> bool
|
||||||
@@ -21,7 +21,7 @@ sane-lib = rec {
|
|||||||
|
|
||||||
# merges N attrsets
|
# merges N attrsets
|
||||||
# Type: flattenAttrsList :: [AttrSet] -> AttrSet
|
# Type: flattenAttrsList :: [AttrSet] -> AttrSet
|
||||||
flattenAttrsets = l: lib.foldl' lib.attrsets.unionOfDisjoint {} l;
|
joinAttrsets = l: lib.foldl' lib.attrsets.unionOfDisjoint {} l;
|
||||||
|
|
||||||
# evaluate a `{ name, value }` pair in the same way that `listToAttrs` does.
|
# evaluate a `{ name, value }` pair in the same way that `listToAttrs` does.
|
||||||
# Type: nameValueToAttrs :: { name :: String, value :: Any } -> Any
|
# Type: nameValueToAttrs :: { name :: String, value :: Any } -> Any
|
||||||
|
@@ -33,7 +33,7 @@ rec {
|
|||||||
merged = builtins.map (p: lib.setAttrByPath p (mergeAtPath p l)) pathsToMerge;
|
merged = builtins.map (p: lib.setAttrByPath p (mergeAtPath p l)) pathsToMerge;
|
||||||
in
|
in
|
||||||
assert builtins.all (i: assertTakesEveryAttr take i []) l;
|
assert builtins.all (i: assertTakesEveryAttr take i []) l;
|
||||||
sane-lib.flattenAttrsets merged;
|
sane-lib.joinAttrsets merged;
|
||||||
|
|
||||||
# `take` is as in mkTypedMerge. this function queries which items `take` is interested in.
|
# `take` is as in mkTypedMerge. this function queries which items `take` is interested in.
|
||||||
# for example:
|
# for example:
|
||||||
|
Reference in New Issue
Block a user