lib: add concatMap

This commit is contained in:
Dmitriy Pleshevskiy 2022-09-15 10:10:43 +03:00
parent 188ace87db
commit b82eb761c4
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215

13
lib.nix
View file

@ -13,6 +13,12 @@ rec {
in
fold' 0;
concatMap = op: list:
let
concat = (a: b: op a + b);
in
foldr concat "" list;
extractAttrs = attr: list:
let
getAttr' = builtins.getAttr attr;
@ -30,10 +36,5 @@ rec {
EOF
'';
mkLuaRc = contents:
let
concat = (a: b: a + b);
luaHeredors = builtins.map mkLuaHeredoc contents;
in
foldr concat "" luaHeredors;
mkLuaRc = contents: concatMap mkLuaHeredoc contents;
}