rename flattenAttrsets -> joinAttrsets to disambiguate

This commit is contained in:
2023-01-09 09:52:37 +00:00
parent eef66df36d
commit ca62f1b62f
2 changed files with 3 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ sane-lib = rec {
# like `builtins.listToAttrs` but any duplicated `name` throws error on access.
# 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)
# Type: isPrefixOfList :: [Any] -> [Any] -> bool
@@ -21,7 +21,7 @@ sane-lib = rec {
# merges N attrsets
# 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.
# Type: nameValueToAttrs :: { name :: String, value :: Any } -> Any

View File

@@ -33,7 +33,7 @@ rec {
merged = builtins.map (p: lib.setAttrByPath p (mergeAtPath p l)) pathsToMerge;
in
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.
# for example: