add genAttrs to nt.std
This commit is contained in:
parent
14f30ce5d7
commit
976ab6b80f
1 changed files with 6 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue