Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generators.toPretty and traceValSeqN #26433

Merged
merged 3 commits into from
Jun 21, 2017
Merged

Conversation

Profpatsch
Copy link
Member

First introduces a pretty printing generator, then uses that to create a debugging function that only goes n levels deep. See commit messages.

`toPretty` implements a pretty printer for nix values.
Strict trace functions that only go down to a specified depth.
Handy to get a better picture and prevent infinite recursions.
@mention-bot
Copy link

@Profpatsch, thanks for your PR! By analyzing the history of the files in this pull request, we identified @MarcWeber, @edolstra and @zagy to be potential reviewers.

@Profpatsch Profpatsch changed the title Trace val seq n generators.toPretty and traceValSeqN Jun 6, 2017
With `builtins.functionArgs` we can get some information if the first argument
is an attrset and whether the contained fields have default values. Encode that
into the pretty-printed lambda.
@Profpatsch Profpatsch requested a review from aszlig June 12, 2017 05:12
@edolstra
Copy link
Member

IMHO it would be better to do this in Nix itself (e.g. by extending printValue()) so that tools like nix repl could use it.

@Profpatsch
Copy link
Member Author

so that tools like nix repl could use it

Why would nix-repl not be able to use nix functions to determine pretty printing?

@Profpatsch
Copy link
Member Author

I will just merge now, since nothing else depends on it. If need be, we can integrate it into nix later.

@Profpatsch Profpatsch merged commit 5cbc6ca into NixOS:master Jun 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants