diff --git a/lib/fixed-points.nix b/lib/fixed-points.nix index 2f818c88de5..968930526a6 100644 --- a/lib/fixed-points.nix +++ b/lib/fixed-points.nix @@ -30,9 +30,12 @@ rec { # nix-repl> converge (x: x / 2) 16 # 0 converge = f: x: - if (f x) == x - then x - else converge f (f x); + let + x' = f x; + in + if x' == x + then x + else converge f x'; # Modify the contents of an explicitly recursive attribute set in a way that # honors `self`-references. This is accomplished with a function