concatLists (map ...) -> concatMap

This commit is contained in:
Eelco Dolstra 2015-07-23 18:31:17 +02:00
parent 0ae8b365b3
commit 4cc6c83477

View file

@ -182,18 +182,18 @@ rec {
let let
loc = prefix ++ [name]; loc = prefix ++ [name];
# Get all submodules that declare name. # Get all submodules that declare name.
decls = concatLists (map (m: decls = concatMap (m:
if m.options ? ${name} if m.options ? ${name}
then [ { inherit (m) file; options = m.options.${name}; } ] then [ { inherit (m) file; options = m.options.${name}; } ]
else [] else []
) options); ) options;
# Get all submodules that define name. # Get all submodules that define name.
defns = concatLists (map (m: defns = concatMap (m:
if m.config ? ${name} if m.config ? ${name}
then map (config: { inherit (m) file; inherit config; }) then map (config: { inherit (m) file; inherit config; })
(pushDownProperties m.config.${name}) (pushDownProperties m.config.${name})
else [] else []
) configs); ) configs;
nrOptions = count (m: isOption m.options) decls; nrOptions = count (m: isOption m.options) decls;
# Extract the definitions for this loc # Extract the definitions for this loc
defns' = map (m: { inherit (m) file; value = m.config.${name}; }) defns' = map (m: { inherit (m) file; value = m.config.${name}; })