glistix/nix
Library for interacting with Nix built-in types and functions.
Types
Functions
pub fn deep_eval(expression: a) -> a
Evaluates the expression strictly, recursively.
Nix is lazy by default, so most values aren’t actually computed until
prompted to by evaluation. This function can be used to force a value
(one of the parameters) to be recursively evaluated upon evaluation.
That is, once this function is called, the given value and any values
within it (such as list items or attribute set values) are also evaluated.
This is used to ensure side-effects, such as printing (through trace
)
or panics, are applied even from within data structures.
Please note that misusing this function may result in performance losses, or even infinite recursion with infinite data structures.
Examples
{
deep_eval([panic as "Bad")])
"Unreachable here"
10
}
// -> error: Bad