concatMapAttrsStringSep
lib.concatMapAttrsStringSep
Docs pulled from | This Revision | 10 minutes ago
Like concatMapStringsSep
but takes an attribute set instead of a list.
Inputs
sep
- Separator to add between item strings
f
- Function that takes each key and value and return a string
attrs
- Attribute set to map from
Type
concatMapAttrsStringSep :: String -> (String -> Any -> String) -> AttrSet -> String
Examples
lib.strings.concatMapAttrsStringSep
usage example
concatMapAttrsStringSep "\n" (name: value: "${name}: foo-${value}") { a = "0.1.0"; b = "0.2.0"; }
=> "a: foo-0.1.0\nb: foo-0.2.0"
Noogle detected
Implementation
The following is the current implementation of this function.
concatMapAttrsStringSep =
sep: f: attrs:
concatStringsSep sep (lib.attrValues (lib.mapAttrs f attrs));