@@ -236,12 +236,17 @@ rec {
236236 + libStr.concatMapStringsSep introSpace (go (indent + " ")) v
237237 + outroSpace + "]"
238238 else if isFunction v then
239− let fna = lib.functionArgs v;
239+ # functionArgs throws in case of (partially applied) builtins
240+ # on nix before commit b2748c6e99239ff6803ba0da76c362790c8be192
241+ # which includes current nix stable
242+ # TODO remove tryEval workaround when the issue is resolved on nix stable
243+ let fna = builtins.tryEval (lib.functionArgs v);
240244 showFnas = concatStringsSep ", " (libAttr.mapAttrsToList
241245 (name: hasDefVal: if hasDefVal then name + "?" else name)
242− fna);
243− in if fna == {} then "<function>"
244− else "<function, args: {${showFnas}}>"
246+ fna.value);
247+ in if !fna.success || fna.value == {}
248+ then "<function>"
249+ else "<function, args: {${showFnas}}>"
245250 else if isAttrs v then
246251 # apply pretty values if allowed
247252 if attrNames v == [ "__pretty" "val" ] && allowPrettyValues