From b82eb761c4f8cb54d0359897c5a68a1eae5826f5 Mon Sep 17 00:00:00 2001 From: janabhumi Date: Thu, 15 Sep 2022 10:10:43 +0300 Subject: [PATCH] lib: add concatMap --- lib.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib.nix b/lib.nix index 037adb0..c4479bd 100644 --- a/lib.nix +++ b/lib.nix @@ -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; }