···542542 attrs:
543543 map (name: f name attrs.${name}) (attrNames attrs);
544544545545+ /*
546546+ Deconstruct an attrset to a list of name-value pairs as expected by [`builtins.listToAttrs`](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-listToAttrs).
547547+ Each element of the resulting list is an attribute set with these attributes:
548548+ - `name` (string): The name of the attribute
549549+ - `value` (any): The value of the attribute
550550+551551+ The following is always true:
552552+ ```nix
553553+ builtins.listToAttrs (attrsToList attrs) == attrs
554554+ ```
555555+556556+ :::{.warning}
557557+ The opposite is not always true. In general expect that
558558+ ```nix
559559+ attrsToList (builtins.listToAttrs list) != list
560560+ ```
561561+562562+ This is because the `listToAttrs` removes duplicate names and doesn't preserve the order of the list.
563563+ :::
564564+565565+ Example:
566566+ attrsToList { foo = 1; bar = "asdf"; }
567567+ => [ { name = "bar"; value = "asdf"; } { name = "foo"; value = 1; } ]
568568+569569+ Type:
570570+ attrsToList :: AttrSet -> [ { name :: String; value :: Any; } ]
571571+572572+ */
573573+ attrsToList = mapAttrsToList nameValuePair;
574574+545575546576 /* Like `mapAttrs`, except that it recursively applies itself to
547577 the *leaf* attributes of a potentially-nested attribute set: