Mika Bohinen / NixCon 2026

Worked examples

Inspect the definitions, change the expression, and compare checkpoints.

Worked example

The fold returns an attribute set. Ask for its names without demanding the value of total.

Definitions · example.nix
n = 100000;
ticks = builtins.genList (i: i) n;
result = builtins.foldl'
  (acc: _: { total = acc.total + 1; })
  { total = 0; } ticks;

Empty source

    Inspect the code, then run the expression.

    Result
    Not run
    Reference