listToAttrs
lib.listToAttrs
Primop
Docs pulled from | This Revision | about 1 hour ago
Takes 1 arguments
e
Construct a set from a list specifying the names and values of each
attribute. Each element of the list should be a set consisting of a
string-valued attribute name
specifying the name of the attribute,
and an attribute value
specifying its value.
In case of duplicate occurrences of the same name, the first takes precedence.
Example:
builtins.listToAttrs
[ { name = "foo"; value = 123; }
{ name = "bar"; value = 456; }
{ name = "bar"; value = 420; }
]
evaluates to
{ foo = 123; bar = 456; }
Noogle detected
Detected Type
listToAttrs :: [{name :: String; value :: a}] -> AttrSet
Implementation
This function is implemented in c++ and is part of the native nix runtime.