Noogλe

search input

Function of the day

  • 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 -> [Any]
    

    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/"; }]