query
On this page

mapAttrsRecursiveCond

lib.attrsets.mapAttrsRecursiveCond

Docs pulled from | This Revision | 21 minutes ago


Like mapAttrsRecursive, but it takes an additional predicate that tells it whether to recurse into an attribute set. If the predicate returns false, mapAttrsRecursiveCond does not recurse, but instead applies the mapping function. If the predicate returns true, it does recurse, and does not apply the mapping function.

Map over an leaf attributes defined by a condition

Map derivations to their name attribute. Derivatons are identified as attribute sets that contain { type = "derivation"; }.

mapAttrsRecursiveCond
  (as: !(as ? "type" && as.type == "derivation"))
  (x: x.name)
  attrs

Type

mapAttrsRecursiveCond :: (AttrSet -> Bool) -> ([String] -> a -> b) -> AttrSet -> AttrSet

Noogle also knows

Aliases