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

Add nix repl :probe #12622

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Add nix repl :probe #12622

wants to merge 1 commit into from

Conversation

roberth
Copy link
Member

@roberth roberth commented Mar 9, 2025

Motivation

For checking laziness (to a degree)

$ src/nix/nix repl -f ~/nixpkgs
Added 23851 variables.
nix-repl> :probe hello
a thunk

nix-repl> :probe stdenv
a set

nix-repl> :probe pythonPackages
a thunk

nix-repl> :probe python39Packages
a thunk

A thunk can be very superficial, but it's at least something

nix-repl> x = true

nix-repl> y = const true null

nix-repl> x
true

nix-repl> :probe x 
a Boolean

nix-repl> :probe y 
a thunk

TODO

  • tests

Ideas

Could be extended to provide information about the thunk, such as the kind of thunk (expression, delayed application, blackhole), and/or the relevant source locations for each.

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

For checking laziness (to a degree)
@github-actions github-actions bot added the repl The Read Eval Print Loop, "nix repl" command and debugger label Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
repl The Read Eval Print Loop, "nix repl" command and debugger
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant