Skip to content

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