Rename mergeDefinitions internal steps to functions which are independent of each others.
This commit is contained in:
parent
83dc60456e
commit
dd4f5f6b78
|
@ -274,20 +274,21 @@ rec {
|
||||||
defsFinal =
|
defsFinal =
|
||||||
let
|
let
|
||||||
# Process mkMerge and mkIf properties
|
# Process mkMerge and mkIf properties
|
||||||
discharged = concatMap (m:
|
processIfAndMerge = defs: concatMap (m:
|
||||||
map (value: { inherit (m) file; inherit value; }) (dischargeProperties m.value)
|
map (value: { inherit (m) file; inherit value; }) (dischargeProperties m.value)
|
||||||
) defs;
|
) defs;
|
||||||
|
|
||||||
# Process mkOverride properties
|
# Process mkOverride properties
|
||||||
overridden = filterOverrides discharged;
|
processOverride = defs: filterOverrides defs;
|
||||||
|
|
||||||
# Sort mkOrder properties
|
# Sort mkOrder properties
|
||||||
sorted =
|
processOrder = defs:
|
||||||
# Avoid sorting if we don't have to.
|
# Avoid sorting if we don't have to.
|
||||||
if any (def: def.value._type or "" == "order") overridden
|
if any (def: def.value._type or "" == "order") defs
|
||||||
then sortProperties overridden
|
then sortProperties defs
|
||||||
else overridden;
|
else defs;
|
||||||
in sorted;
|
in
|
||||||
|
processOrder (processOverride (processIfAndMerge defs));
|
||||||
|
|
||||||
# Type-check the remaining definitions, and merge them
|
# Type-check the remaining definitions, and merge them
|
||||||
mergedValue = fold (def: res:
|
mergedValue = fold (def: res:
|
||||||
|
|
Loading…
Reference in New Issue