query
On this page

collect

lib.collect

Docs pulled from | This Revision | 21 minutes ago


Recursively collect sets that verify a given predicate named pred from the set attrs. The recursion is stopped when the predicate is verified.

Inputs

pred

Given an attribute's value, determine if recursion should stop.

attrs

The attribute set to recursively collect.

Type

collect :: (AttrSet -> Bool) -> AttrSet -> [x]

Examples

lib.attrsets.collect usage example

collect isList { a = { b = ["b"]; }; c = [1]; }
=> [["b"] [1]]

collect (x: x ? outPath)
   { a = { outPath = "a/"; }; b = { outPath = "b/"; }; }
=> [{ outPath = "a/"; } { outPath = "b/"; }]
(lib.attrsets.collect)

Noogle also knows

Aliases