Try builtins.deepSeq
: something like builtins.trace (builtins.deepSeq some-list some-list) false
According to the manual, it evaluates its first argument deeply and returns the second.
All about NixOS - https://nixos.org/
Try builtins.deepSeq
: something like builtins.trace (builtins.deepSeq some-list some-list) false
According to the manual, it evaluates its first argument deeply and returns the second.
The nix language is lazy by definition. In your example, the code on your let block is never fully evaluated (executed), because it is never needed. Hence, [ <code> <code> ]
is the only possible outcome.
I figured that much :) I was wondering about the "best" (recommended? idiomatic?) way to get some decent/usable output instead of <code>
or unformatted JSON (from builtins.toJSON
).
For simple things like this, I usually just use the REPL to prototype the function