diff --git a/nt/primitives/bootstrap/std/attrs.nix b/nt/primitives/bootstrap/std/attrs.nix index 32339c8..e2bd7ec 100644 --- a/nt/primitives/bootstrap/std/attrs.nix +++ b/nt/primitives/bootstrap/std/attrs.nix @@ -8,6 +8,7 @@ hasAttr head length + listToAttrs mapAttrs partition removeAttrs @@ -41,6 +42,11 @@ in rec { getAttrDefault = name: default: getAttrOr name (_: default); + genAttrs = names: f: + names + |> map (n: nameValuePair n (f n)) + |> listToAttrs; + mergeAttrsList = list: let # `binaryMerge start end` merges the elements at indices `index` of `list` such that `start <= index < end` # Type: Int -> Int -> Attrs