fold -> foldr

This commit is contained in:
mjallen18
2025-12-01 09:38:41 -06:00
parent 1e41848ba9
commit 07d7456158

View File

@@ -24,7 +24,7 @@ let
fix fix
filterAttrs filterAttrs
mergeAttrs mergeAttrs
fold foldr
recursiveUpdate recursiveUpdate
callPackageWith callPackageWith
isFunction isFunction
@@ -34,13 +34,13 @@ let
# Type: [Attrs] -> Attrs # Type: [Attrs] -> Attrs
# Usage: merge-deep [{ x = 1; } { x = 2; }] # Usage: merge-deep [{ x = 1; } { x = 2; }]
# result: { x = 2; } # result: { x = 2; }
merge-deep = fold recursiveUpdate { }; merge-deep = foldr recursiveUpdate { };
# Merge the root of a list of attribute sets. # Merge the root of a list of attribute sets.
# Type: [Attrs] -> Attrs # Type: [Attrs] -> Attrs
# Usage: merge-shallow [{ x = 1; } { x = 2; }] # Usage: merge-shallow [{ x = 1; } { x = 2; }]
# result: { x = 2; } # result: { x = 2; }
merge-shallow = fold mergeAttrs { }; merge-shallow = foldr mergeAttrs { };
# Transform an attribute set of inputs into an attribute set where # Transform an attribute set of inputs into an attribute set where
# the values are the inputs' `lib` attribute. Entries without a `lib` # the values are the inputs' `lib` attribute. Entries without a `lib`