catAttrs
lib.attrsets.catAttrs
Primop
Docs pulled from | This Revision | 10 minutes ago
Takes 2 arguments
attr, list
Collect each attribute named attr
from a list of attribute
sets. Sets that don't contain the named attribute are ignored.
Inputs
attr
-
The attribute name to get out of the sets.
list
-
The list of attribute sets to go through
Type
catAttrs :: String -> [AttrSet] -> [Any]
Examples
lib.attrsets.catAttrs
usage example
catAttrs "a" [{a = 1;} {b = 0;} {a = 2;}]
=> [1 2]
Noogle detected
Implementation
This function is implemented in c++ and is part of the native nix runtime.
Implementation
The following is the current implementation of this function.
catAttrs = builtins.catAttrs;