module system: rework module merging

The asymptotic complexity is now much lower.
This commit is contained in:
Symphorien Gibol
2018-08-27 17:11:58 +02:00
parent 6afd19e699
commit 526d604670
2 changed files with 46 additions and 22 deletions
+1 -1
View File
@@ -145,7 +145,7 @@ rec {
foldAttrs = op: nul: list_of_attrs:
fold (n: a:
fold (name: o:
o // (listToAttrs [{inherit name; value = op n.${name} (a.${name} or nul); }])
o // { ${name} = op n.${name} (a.${name} or nul); }
) a (attrNames n)
) {} list_of_attrs;