query
On this page

collect

lib.collect



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

Example

collect isList { a = { b = ["b"]; }; c = [1]; }
=> [["b"] [1]]
collect (x: x ? outPath)
   { a = { outPath = "a/"; }; b = { outPath = "b/"; }; }
=> [{ outPath = "a/"; } { outPath = "b/"; }]

Type

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

Arguments

  • [pred] Given an attribute's value, determine if recursion should stop.
  • [attrs] The attribute set to recursively collect.
(lib.attrsets.collect)

Noogle also knows

Aliases