summaryrefslogtreecommitdiffstats
path: root/lib/generators.nix
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2020-09-17 18:08:44 +0200
committerSilvan Mosberger <contact@infinisil.com>2020-09-17 18:20:35 +0200
commitd0be9e98109428e67e4b7fab3e49728cc6633073 (patch)
treeb0f9f263e84ccf3f105e4edce0ad865f79f939de /lib/generators.nix
parent073e9b2aed0f855ce26bd3a26dab044c0c17c817 (diff)
lib/generators.toPretty: Switch away from δ and λ
- These symbols can be confusing for those not familiar with them - There's no harm in making these more obvious - Terminals may not print them correctly either Also changes the function argument printing slightly to be more obvious
Diffstat (limited to 'lib/generators.nix')
-rw-r--r--lib/generators.nix12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/generators.nix b/lib/generators.nix
index 81bedd13d80a..205092a2681b 100644
--- a/lib/generators.nix
+++ b/lib/generators.nix
@@ -237,10 +237,8 @@ rec {
# apply pretty values if allowed
if attrNames v == [ "__pretty" "val" ] && allowPrettyValues
then v.__pretty v.val
- # TODO: there is probably a better representation?
else if v ? type && v.type == "derivation" then
- "<δ:${v.name}>"
- # "<δ:${concatStringsSep "," (builtins.attrNames v)}>"
+ "<derivation ${v.drvPath}>"
else "{" + introSpace
+ libStr.concatStringsSep introSpace (libAttr.mapAttrsToList
(name: value:
@@ -248,11 +246,11 @@ rec {
+ outroSpace + "}"
else if isFunction v then
let fna = lib.functionArgs v;
- showFnas = concatStringsSep "," (libAttr.mapAttrsToList
- (name: hasDefVal: if hasDefVal then "(${name})" else name)
+ showFnas = concatStringsSep ", " (libAttr.mapAttrsToList
+ (name: hasDefVal: if hasDefVal then name + "?" else name)
fna);
- in if fna == {} then "<λ>"
- else "<λ:{${showFnas}}>"
+ in if fna == {} then "<function>"
+ else "<function, args: {${showFnas}}>"
else abort "generators.toPretty: should never happen (v = ${v})";
in go "";